AnsweredAssumed Answered

quantity macro with excel parts-only BOM

Question asked by Laura Arns on Jul 14, 2016

Our workflow requires a parts-only BOM to created from the top assembly, and we have an Excel BOM template to handle this. The files are also named in a very formulaic way. I think I could use the information already generated there to write the total quantity property to each of the part files, and get the BOM file created all in one go, and avoid the macro traversing through the assembly an unnecessary time. Here's how I think it might flow:


-User runs the macro from top-level assembly

-macro asks how many of the assembly is to be made (an int value)

-sets all lightweight components to resolved

-parts-only BOM is created and saved out with the file name scheme of [file name] BOM Qty [user-defined quantity] [Date run]

-column is added (or already exists in the excel template) for total to be created instead of for one instance of top-level assembly, and filled out by multiplying the qty column by the user-defined quantity

-solidworks checks the entry for part number (which links to the file name in our BOM) and writes the total quantity (and possibly the quantity for just one instance, if desired by the shop in the end), to the custom properties of the part file with that name (a string comparison) within the assembly.


My question is, is there a reason this wouldn't work, and what kinds of functions should I be looking up to make this happen if it can work?