- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Determine BOM Structure of a part from within a drawing
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.kNormalBOMStructurebut not when it is
BOMStructureEnum.kReferenceBOMStructureThe 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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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!