Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
801 Views, 6 Replies

Error getting BOMRows

Can someone please help with an error I'm getting when I try to access the BOMRowsEnumerator object ???

 

Dim oAsmComp As ComponentDefinition = oRefDoc.ComponentDefinition

 

Dim oBOM As BOM = oAsmComp.BOM

oBOM.StructuredViewEnabled = True
oBOM.StructuredViewFirstLevelOnly = False

 

Dim oBOMView As BOMView = oBOM.BOMViews("Structured")

 

Dim oBOMRows As BOMRowsEnumerator = oBOMView.BOMRows

 

The error is generated on the red line and the details of it are:

 

System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.BOMView.get_BOMRows()
at Costing.LmiRuleScript.PartCount(AssemblyDocument oRefDoc, StreamWriter oWrite, Int32& oCount, Int32& oManuPartCount, Int32& oAssemblyCount, Int32& oFastenerCount, Int32& oComponentCount)
at Costing.LmiRuleScript.OpTime(Document oRefDoc, StreamWriter oWrite, Int32 Amount)
at Costing.LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)