Modify Bom Table Settings (add Custom iProperty Column)

Modify Bom Table Settings (add Custom iProperty Column)

Maxim-CADman77
Advisor Advisor
123 Views
3 Replies
Message 1 of 4

Modify Bom Table Settings (add Custom iProperty Column)

Maxim-CADman77
Advisor
Advisor

Recently, I was asked to automate customization of BOM Table settings (add column of a custom iProperty)

I don't see any easy way thus the plan is to export current  settings to XML file, modify the file in a necessary way, import settings back from the modified XML file.

I manually exported xml twice (before and after adding the column). The files differ quite a lot.

1. Thus my first question is - if there any description of that XML?

2. I also get Exception 80004005 when I try to export settings with API

If Not TypeOf ThisDoc.Document Is AssemblyDocument Then MsgBox("Not Assy!") : Return

Dim aDoc As AssemblyDocument = ThisDoc.Document
Dim aDef As AssemblyComponentDefinition = aDoc.ComponentDefinition
Dim aBom As BOM = aDef.BOM
Logger.Info("aBom: " & If(aBom Is Nothing, "-", "+"))
Logger.Info("BOMViews Count: " & aBom.BOMViews.Count)

Dim aBomCstSetFilePath As String = "C:\Temp\BomCstSets.xml" ' aDoc.FullFilename & "_BomCstSets.xml" ' System.IO.Path.ChangeExtension(aDoc.FullFilename, "xml")
Logger.Info("aBomCstSetFilePath: " & aBomCstSetFilePath)

aBom.ExportBOMCustomization(aBomCstSetFilePath) ' Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

Dear@MjDeck, can you, please, study #2 ?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
124 Views
3 Replies
Replies (3)
Message 2 of 4

MjDeck
Autodesk
Autodesk

Hi Maxim - I don't think we provide documentation for what's in that XML file. It's just intended to be exported and  then imported unchanged.
I tested your rule on a simple assembly and didn't see an error. Can you post an assembly that shows the error?


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 3 of 4

Maxim-CADman77
Advisor
Advisor

For me this is reproducible on simplest assy like the scissors from standard samples kit attached.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 4 of 4

MjDeck
Autodesk
Autodesk

We have a plan (internal number INVGEN-82678) to provide new API functions to add or remove iProperty columns in the BOM.

To export the BOM customization from the Scissors assembly, the following worked for me. I tested in Inventor 2025. I think this would work in other versions as well.

  1. The output file must not already exist. The API function will not overwrite it. It will error out instead. You could add code to your rule to delete it if it already exists.
  2. Each BOM view must have customization. Unlike the UI, the API export won't work if the BOM is default.
  3. All BOM views must be enabled.

I'm not absolutely sure about point 3.

For point 2, the only thing I tested was adding a column with a standard iProperty. I'm guessing that adding a custom iProperty would also make it work. Maybe there are other customizations as well.

I created issue INVGEN-86739 for this problem. Customization export should work the same in the UI and API.

 


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes