Is there API access to the structured BOM settings?

Is there API access to the structured BOM settings?

nbonnett-murphy
Advocate Advocate
519 Views
5 Replies
Message 1 of 6

Is there API access to the structured BOM settings?

nbonnett-murphy
Advocate
Advocate

Specifically "Renumber items sequentially" as shown in the screenshot. I would like to make an iLogic script that'll turn off that setting every time I open an assembly.

 

I often have to maintain large assemblies where the print bubbles need to match an external database. This setting causes me all sorts of problems, because a minor change to the subcomponents can shuffle all of the item numbers, resulting in an hour of work renumbering the partslist and pushing the overrides back into the assembly.

 

Our newest templates have this setting off by default, but there is a substantial chunk of data that has it turned on. When this feature was added to inventor, it was on by default and there wasn't a way to turn it off in templates, so anything we made in the intervening time has it turned on unfortunately.

 

nbonnettmurphy_0-1687972157014.png

I dug through the API docs, but I wasn't able to find anything that looked promising.

0 Likes
Accepted solutions (2)
520 Views
5 Replies
Replies (5)
Message 2 of 6

WCrihfield
Mentor
Mentor
Accepted solution

Hi @nbonnett-murphy.  Yes.  Once you get to the BOM object (under the AssemblyDocument.ComponentDefinition.BOM), that BOM objec has those properties that you can change the values of.

BOM.HideSuppressedComponentsInBOM, which is a Boolean (True/False)

and

BOM.RenumberItemsSequentially, which is also a Boolean

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 6

WCrihfield
Mentor
Mentor
Accepted solution

Here is a simple iLogic rule to turn both of those settings off, if you run the rule while an assembly is active.

Sub Main
	If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Exit Sub
	Dim oADoc As AssemblyDocument = ThisDoc.Document
	Dim oBOM As BOM = oADoc.ComponentDefinition.BOM
	oBOM.HideSuppressedComponentsInBOM = False
	oBOM.RenumberItemsSequentially = False
	If oADoc.RequiresUpdate Then oADoc.Update2(True)
End Sub

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 6

nbonnett-murphy
Advocate
Advocate

Awesome thanks! Where did you find those properties? the only place I know to look is here, and I couldn't find it.

 

Did you get the autocomplete feature to give it to you in the ilogic editor? Or is there a better resource?

0 Likes
Message 5 of 6

WCrihfield
Mentor
Mentor

Actually those were both introcuded in the 2023 version of Inventor, so they do not show up in the online help until you are in those versions of the online help.  If you are using an earlier version and these worked for you, then maybe they were hidden properties before that point.  Hidden properties are generally not stable for production use, or they would have been exposed for public use.  They may have been developing them at the time.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 6 of 6

nbonnett-murphy
Advocate
Advocate
Oh wow, I didn't even realize there were different help sites for each version. I just let my browser autocomplete take me there since I always have a hard time finding it. I just noticed that F1 while in the iLogic editor will get me to the right place.

Thanks very much for the help!
0 Likes