Hey Everone,
I'm looking for a function that should find a title and enter a new Item numbering in the assembly BOM according to the specified title.
For Example:
Look for title "Grease nipple lengthening" in the BOM and change the item to "4"
I would like to use it to renumber the BOM in my configuration tool. During the configuration, the Item numbers are overwritten because I turn certain components on or off depending on the configuration conditions. But I always want to have a parts list with the following scheme.
For example, a BOM with finished configuration.
Before new numbering (see pic)
Necessary BOM
After new numbering (see pic)
Maybe an iLogic-Code like that here
If Title = "Rope drum steel struct." then
oBomRow.itemNumber = 1
If Title = "Bushing" then
oBomRow.itemNumber = 2
and so on
I use following ILogic- Code to configured the lubrication
Select Case Lubrication_Lengthening
Case "150 mm"
Component.Visible("155501_0-03-ENG-025951:1") = False
Component.Visible("155501_0-03-ENG-025951:2") = False
Component.Visible("03-138_728_0INV:1") = True
Component.Visible("03-138_728_0INV:2") = True
Component.Visible("EKT-000247:1") = False
Component.Visible("EKT-000247:2") = False
Case "300 mm"
Component.Visible("155501_0-03-ENG-025951:1") = True
Component.Visible("155501_0-03-ENG-025951:2") = True
Component.Visible("03-138_728_0INV:1") = False
Component.Visible("03-138_728_0INV:2") = False
Component.Visible("EKT-000247:1") = False
Component.Visible("EKT-000247:2") = False
Case Else
Component.Visible("155501_0-03-ENG-025951:1") = False
Component.Visible("155501_0-03-ENG-025951:2") = False
Component.Visible("03-138_728_0INV:1") = False
Component.Visible("03-138_728_0INV:2") = False
Component.Visible("EKT-000247:1") = True
Component.Visible("EKT-000247:2") = True
End Select
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences
'check for and skip virtual components
If Not TypeOf oOccurrence.Definition Is VirtualComponentDefinition Then
'set BOM as default if the component is visible
If Component.Visible(oOccurrence.Name) = True Then
Component.InventorComponent(oOccurrence.Name).BOMStructure = _
BOMStructureEnum.kDefaultBOMStructure
'set BOM as reference if the component is not visible
ElseIf Component.Visible(oOccurrence.Name) = False Then
Component.InventorComponent(oOccurrence.Name).BOMStructure = _
BOMStructureEnum.kReferenceBOMStructure
End If
Else
End If
Next
Many thanks
On the second page of the forum you can bury corpses.
Therefore, I push my question again.
Does anyone have any idea how to create a consistent BOM?
Can't find what you're looking for? Ask the community or share your knowledge.