Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is there API access to the structured BOM settings?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
nbonnett-murphy
287 Views, 5 Replies

Is there API access to the structured BOM settings?

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.

5 REPLIES 5
Message 2 of 6

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

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

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?

Message 5 of 6

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

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!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report