BOM StructuredViewFirstLevelOnly = False ArgumentException
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to set the BOM Structured options. I get the following error when I try to change the StructuredViewFirstLevelOnly property from both the assembly and drawing environments. All this code came from the help files. Any suggestions?
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
Code from the drawing environment.
' Set a reference to the referenced model document
Dim oModelDoc As Document
oModelDoc = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument
' First check if the 'structured' BOM view has been enabled in the model
' Set a reference to the model's BOM object
Dim oBOM As BOM
oBOM = oModelDoc.ComponentDefinition.BOM
oBOM.StructuredViewFirstLevelOnly = False ' This Line Crashes.
oBOM.StructuredViewEnabled = True