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: 

BOM Structure - iLogic

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
kresh.bell
277 Views, 2 Replies

BOM Structure - iLogic

Hi,

is it possible to create an iLogic that would open the BOM Structure menu when running?

kreshbell_0-1712998143272.png

 

For example, control type as a Radio Group

kreshbell_1-1712998510985.png

 

or Combo Box

kreshbell_2-1712998616312.png

 

 

2 REPLIES 2
Message 2 of 3

Hi @kresh.bell . You can use this iLogic code in a part or assembly document.

Dim oDoc As Document = ThisDoc.Document
If oDoc.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub
Dim sList As New List(Of String)
sList.AddRange({"Normal", "Inseparable", "Purchased", "Phantom", "Reference" })
Dim i As Integer = -1
Select Case oDoc.ComponentDefinition.BOMStructure
Case BOMStructureEnum.kNormalBOMStructure : i = 0
Case BOMStructureEnum.kInseparableBOMStructure : i = 1
Case BOMStructureEnum.kPurchasedBOMStructure : i = 2
Case BOMStructureEnum.kPhantomBOMStructure : i = 3
Case BOMStructureEnum.kReferenceBOMStructure : i = 4
End Select
Dim sBOM As String
sBOM = InputListBox(oDoc.DisplayName, sList, sList(i), Title := "BOM Structure.", ListName := "Select BOM Structure:")
If String.IsNullOrEmpty(sBOM) Then Exit Sub
Select Case sBOM
Case "Normal" : oDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kNormalBOMStructure
Case "Inseparable" : oDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kInseparableBOMStructure
Case "Purchased" : oDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kPurchasedBOMStructure
Case "Phantom" : oDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kPhantomBOMStructure
Case "Reference" : oDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
End Select

 

Andrii Humeniuk - Leading design engineer

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 3

It works perfect, thanks!! Sorry for delay

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report