Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using Inventor 2019 with ILogic. This code has one error in the last line
Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument
' Set a reference to the BOM
Dim oBOM As BOM
oBOM = oDoc.ComponentDefinition.BOM
' Set the structured view to 'all levels'
oBOM.StructuredViewFirstLevelOnly = False
' Make sure that the structured view is enabled.
oBOM.StructuredViewEnabled = True
' Set a reference to the "Structured" BOMView
Dim oStructuredBOMView As BOMView
oStructuredBOMView = oBOM.BOMViews.Item("Structured")
and the error is:
System.ArgumentException: Parametro non corretto. (Eccezione da HRESULT: 0x80070057 (E_INVALIDARG))
in System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
in Inventor.BOMViews.get_Item(Object Index)
in ThisRule.Main()
in Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
in iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
How can I solve the problem?
Thanks, Luca
Solved! Go to Solution.