ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
TATommy Alatalo22/02/2017

I need to loop through all levels of a drawing BOM from top level down and find all assembly drawings associated.

The goal of this is to find all assembly drawings (and possibly export them as pdfs) associated to the product in the top drawing.

So what I'm looking at is a regular BOM/Assembly structure:

Top level drawing

--> Part

--> Part

--> Part

--> Assembly (Drawing level 2)

     --> Part

     --> Subassembly1 (Drawing level 3)

          --> Part

          --> Subassembly 2 (Drawing level 4)

               --> Part

One way to find all the assemblies I guess would be to add an indented BOM into the drawing, getting the assemblies from it and then deleting it, but I would prefer to use the existing BOM table, and loop through it if possible so that I don't run a risk of getting the wrong BOM data in case the original top level BOM has been edited manually.

I have limited experience with VBA with most of it is coming from Excel, so any pointers or code examples as to approach this is much appreciated.