Use iLogic To Change the Bom Structure of Suppressed parts.

Use iLogic To Change the Bom Structure of Suppressed parts.

Brian.Price
Advocate Advocate
646 Views
1 Reply
Message 1 of 2

Use iLogic To Change the Bom Structure of Suppressed parts.

Brian.Price
Advocate
Advocate

I am wanting to use ilogic to change the BOM structure of parts in an assembly, depending on their level of suppressed or active. I am using this to drive my BOM to have only the active parts in it. We export directly from Inventor's BOM to our inventory control system. 

 

The current code I have been using has been working however it will only change the value once. If the BOM structure is Normal, it can convert it to Phantom but not back. However if it is currently Phantom it can then change it to Normal. I had an Else If statement after this to change the Bom Structure back if the part was active.

 

Here is the code I have been using and have gotten most of it from these forums.

 

I am no where near the pro level you guys are with this so a coding for dummies level of guidance would be appreciated. Thanks!

 

SyntaxEditor Code Snippet

If Component.IsActive("HANDRAIL A:1") = False Then
Dim oOcc As ComponentOccurrence = Component.InventorComponent("HANDRAIL A:1")
oOcc.Definition.BOMStructure = BOMStructureEnum.kPhantomBOMStructure

End If

 

0 Likes
Accepted solutions (1)
647 Views
1 Reply
Reply (1)
Message 2 of 2

johnsonshiue
Community Manager
Community Manager
Accepted solution

Hi! You don't need to change it manually. Here is how it works. Create a custom LOD. Then use the following statement.

 

Component.IsActive("Part1:1") = False

 

The above statement will suppress "Part1:1" and also set its BOM Structure to Reference (deducted from BOM table). Please note that you cannot one component occurrence with two different BOM Structure attributes in two different LODs at the same time.

This workflow works when you try to export BOM table on a per LOD basis. But, it will not work if you create drawing views referencing each LOD state and create PartsList based on each drawing view.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer