Community
Hi,
is it possible to create an iLogic that would open the BOM Structure menu when running?
For example, control type as a Radio Group
or Combo Box
Solved! Go to Solution.
Solved by Andrii_Humeniuk. Go to 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 - 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.
Can't find what you're looking for? Ask the community or share your knowledge.