Anyone have a macro to export a BOM, then delete it?

Jul 26, 2006 4 Replies

I would like to insert a BOM, export it to a editable file, then delete the BOM.



Would it be better to use a SW based BOM or Excel based? SW Bom can export to .txt and .csv, Excel BOM can be exported as .xls.



I don't have one like that, but I wonder if it's necessary to actually go through the process of creating and placing the BOM in the drawing. I would think that since the info is the same, maybe the API would let you create the file directly.

WT

I have one that I did for a customer that created the BOM through the API without inserting a BOM. I can not distribute this one but I can lead you in the right direction. There is an example macro that traverses the assembly and any sub assemblies and their parts. With this you could add the ability to count the number of instances for each component and derive a BOM.

Jeff

Jeff, I actually dont need to list qtys for each part. I simply need the filename (which is our item number), description (custom property), and part type (custom property).

Where is this example macro you are referring to?

You can also use the SWDocManager and the XML stream for assemblies. It is blindingly quick and can be opened in Excel directly. Better still SW does not need to be open to do this. There are examples in the API help.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required