Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good evening,
I created a rule in a subassembly to turn al courrences as Default or reference depnding on a parameter I pass from a top level assembly. When I open the subassembly it runs fine, when I open the top assembly and pass the parameter to the subassembly file I get an error becaus I am trying to define the objects in "Active Document". How can I make this run?
' set a reference to the assembly component definintion Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition 'Iterate through all of the occurrences Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oAsmCompDef.Occurrences 'set BOM Structure If z_visRefCtrl = True oOccurrence.BOMStructure = BOMStructureEnum.kDefaultBOMStructure Else oOccurrence.BOMStructure = BOMStructureEnum.kReferenceBOMStructure End If Next ' pass parameter to angle subassembly Parameter("280-091:1", "z_visRefCtrl") = z_visRefCtrl
Can you hep me figure out what I need to change in the code to have the rule in the subassembly runing?
Solved! Go to Solution.