Export BOM with Template

Export BOM with Template

theo.bot
Collaborator Collaborator
403 Views
2 Replies
Message 1 of 3

Export BOM with Template

theo.bot
Collaborator
Collaborator

Hi,

 

Since Inventor R2022.1 you can use a template when you export a BOM view when using the interface. (Inventor 2023 Help | Assembly Enhancements | Autodesk)

It looks like these BOM export options are not included in the API (Inventor 2023 Help | BOMView.Export Method | Autodesk). 

 

I tried to use the same way as mentioned in the Partlist export options (Inventor 2023 Help | PartsList.Export Method | Autodesk) But that did not work.

 

I know there are a lot of work arounds, but it would make life a lot easier if we can export BOM views directly into a excel template using the API.

 

Does anyone know if these options are supported?

404 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor

I tried a couple of things. but could not get it to work with an object collection. But if you throw in a string you can set 1 option the table name. it works like this.

Dim doc As AssemblyDocument = ThisDoc.Document

Dim bom As BOM = doc.ComponentDefinition.BOM
Dim bomView As BOMView = bom.BOMViews.Item("structured")

Dim file = "D:\folder\file.xlsx"

bomView.Export(file, FileFormatEnum.kMicrosoftExcelFormat, "This_will_become_the_sheet_name")

 I guess that this is not what you are looking for.  But this makes me expect that it's not possible to set more options.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3

theo.bot
Collaborator
Collaborator

Hi @JelteDeJong,

 

Thanks for checking. I had the same conclusion when I was trying to make it work. 

So for now I simply create a drawing in the background, place and export the partslist then close the drawing without save. It works fine, but I hoped to skip this part of my code and do this  directly.

 

I dropped it in the idea station, so let's vote 😁:

 

API Support for Export BOM with Template - Autodesk Community 

0 Likes