iLogic to Export BOM from Assembly and each subassembly to basic Excel template?

iLogic to Export BOM from Assembly and each subassembly to basic Excel template?

Anonymous
Not applicable
633 Views
1 Reply
Message 1 of 2

iLogic to Export BOM from Assembly and each subassembly to basic Excel template?

Anonymous
Not applicable

Ideally this would be done from the top level .iam or associated .idw file.

 

What I'm interested in doing is starting there, at the top level assembly, running the rule, and getting as a result prompted for where to save the file and with what filename. The file would contain one tab for the top level assembly and each subassembly under that, and each subassembly under that; basically for every .iam contained within and including the top-level .iam.

 

Each tab would be formatted identically with item number, qty, description, part number (sorted by item number, first with letters and then numbers); underneath a banner that confirms the assembly number and description. Ideally, the tabs themselves would be named with their assembly's drawing number as well. In my applications, there could be in the neighborhood of 50 tabs.

 

Is this something iLogic is capable of doing? I've done some basic iLogic, but nothing that leverages Excel so heavily or looks into BOMs. This would be an enormous saver if it's possible. I've tried copying snippets that I've found regarding BOMs, but literally everything throws one error or another, and at that point I don't know if I'm repairing code or writing from scratch. 

 

I should mention, currently Inventor Professional 2015, soon to be 2018.

0 Likes
634 Views
1 Reply
Reply (1)
Message 2 of 2

philip1009
Advisor
Advisor

By chance do you also use Autodesk Vault Professional?  If so, there's a built-in BOM export function that might work for you.  Otherwise I'd wait until you get Inventor '18 as there may be extra code snippets for working with Excel.  Otherwise this is something that can be done with iLogic, it won't be too difficult to write out the code.  It'll just be a series of long loops through every assembly level and writing the info to every cell and tab in the excel spreadsheet.

 

If there's a way you could provide an Excel sample or template to base off of I and others who see this post can come in from time to time.

 

For starters, to peruse through the list of documents referenced in an assembly you can start with this loop.

 

oRefDocs = ThisApplication.ActiveDocument.AllReferencedDocuments

For Each oDoc As Document In oRefDocs

	'If oDoc is an assembly file, run BOM export code here

Next

There are plenty of examples of exporting BOMs from individual assemblies, but the trick here is you want it all in one spreadsheet with tabs instead of individual worksheets, keep working at it, and the solution will be found.  Have a good weekend.

 

0 Likes