AnsweredAssumed Answered

API/Macro for updating a BOM

Question asked by Erik Rotolo on Mar 14, 2018
Latest reply on Sep 4, 2018 by Federico Borghi

You have an asm file that has a few configuration and you make a drawing with a drawing view showing config1 of the asm and you insert a BOM referencing config1, everything is good.


You then change the config in the drawing view to config2, but the BOM doesn't update to match.


This is annoying, so you have to select the BOM and match the config that is in the drawing view.  This is OK if its a small list of configs, but is terrible if you have a large amount of asm configs.


Other method of updating BOM after changing configs of asm in drawing view, is to delete the BOM and reinsert the BOM, this also is not the best solution.


I have looked into if you can always keep the BOM linked to the drawing view, but have found that this is not possible.


So, does any one already have a solution to this using a macro?


Or can someone make a macro to do this?


The macro should look to see if there is already a BOM and if it sees there is one, then delete it and insert new BOM based on drawing view specified in sheet properties.  If no BOM is present then create one BOM based on drawing view specified in sheet properties.

In the macro you would need to specify where and what BOM template to use and also to be able to  pick Top Asm BOM or Part BOM or Indented BOM.

But not have the selection as a user inputs every time you run it, just as code line in the body of the macro, that could be edited later if things change.


Thanks in advanced to everyone that shares on this forum.  All you contributors are amazing.