Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Determine BOM Structure of a part from within a drawing

iogurt1
Advocate Advocate
422 Views
1 Reply
Message 1 of 2

Determine BOM Structure of a part from within a drawing

iogurt1
Advocate
Advocate

I have a drawing of an assembly. Inside the .iam I have a configurator that turns certain parts invisible AND turns their BOM Structure to Reference so they don't show up on the BOM anymore. 

Now I am doing drawing automation. Is it possible to determine the BOM Structure of one of these parts from within my drawing so I can tell my code to only place a dimension if my part is 

BOMStructureEnum.kNormalBOMStructure

but not when it is

BOMStructureEnum.kReferenceBOMStructure

 The reason it is still placing dimensions on invisible parts is that I am using Attribute Helper to create my attributes from work points. But they are still technically there even though the part is invisible. 

Also, we don't want to work with Level Of Details, so I'm not looking for any suggestions involving suppression of parts. 

Thanks!

0 Likes
423 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Since the BOMStructureEnum can only be used within an assembly you could place a rule in the assembly that look like this:

 

SyntaxEditor Code Snippet

sArg1 = RuleArguments("Item Name")

If sArg1 <> " " And sArg1 <> "" Then

    If Component.InventorComponent(sArg1).BOMStructure = BOMStructureEnum.kReferenceBOMStructure Then
        SharedVariable("BOM Structure") = "Reference"
        MsgBox("Reference")
    Else MsgBox("Normal")
        SharedVariable("BOM Structure") = "Normal"
    End If

End If

 

Then place a rule in the dwg that looks like this:

 

SyntaxEditor Code Snippet

Dim map As Inventor.NameValueMap 
map = ThisApplication.TransientObjects.CreateNameValueMap()
map.Add("Item Name", "Inlet Section")

iLogicVb.RunRule("Meter Assembly.iam", "Rule10", map)


AssyBOMStruct = SharedVariable("BOM Structure")

If AssyBOMStruct = "Normal" Then
    MsgBox("Run This Stuff")
End If

 

Just change the variable names to fit your application and it should work!

0 Likes