BOM Structure - iLogic

BOM Structure - iLogic

kresh.bell
Collaborator Collaborator
669 Views
2 Replies
Message 1 of 3

BOM Structure - iLogic

kresh.bell
Collaborator
Collaborator

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

 

 

0 Likes
Accepted solutions (1)
670 Views
2 Replies
Replies (2)
Message 2 of 3

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

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 - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

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

EESignature

0 Likes
Message 3 of 3

kresh.bell
Collaborator
Collaborator

It works perfect, thanks!! Sorry for delay

0 Likes