Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a Weldment that I want to change the BOM Structure from default to Reference on all occurrences in the assembly tree.
Here is the code that I have that works on an Assembly File but does not work on a Weldment Assembly File.
' 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 oOccurrence.BOMStructure = BOMStructureEnum.kReferenceBOMStructure Next
If I run this on a Weldment File I get this error
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
If I take it a step further and single out just the Parts in the Tree it runs fine, but if I single out just the assemblies in the tree the same error comes up.
I'm wanting to turn all of the parts and assemblies in the tree to Reference. Thank You for any help.
Solved! Go to Solution.