<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error getting BOMRows in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7620000#M78017</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Be careful with declaring always as "document".&lt;/P&gt;&lt;P&gt;if meant Part than as "partDocument"&lt;/P&gt;&lt;P&gt;If meant Assembly as "Assemblydocument"&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If meant drawing as "DrawingDocument"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This will be&amp;nbsp; the issue I think!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Dec 2017 12:36:10 GMT</pubDate>
    <dc:creator>bradeneuropeArthur</dc:creator>
    <dc:date>2017-12-13T12:36:10Z</dc:date>
    <item>
      <title>Error getting BOMRows</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7619644#M78008</link>
      <description>&lt;P&gt;Can someone please help with an error I'm getting when I try to access the BOMRowsEnumerator object ???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oAsmComp As ComponentDefinition = oRefDoc.ComponentDefinition&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oBOM As BOM = oAsmComp.BOM&lt;BR /&gt;&lt;BR /&gt;oBOM.StructuredViewEnabled = True&lt;BR /&gt;oBOM.StructuredViewFirstLevelOnly = False&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oBOMView As BOMView&amp;nbsp;= oBOM.BOMViews("Structured")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Dim oBOMRows As BOMRowsEnumerator = oBOMView.BOMRows&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;The error is generated on the red line and the details of it are:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;BR /&gt; at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)&lt;BR /&gt; at Inventor.BOMView.get_BOMRows()&lt;BR /&gt; at Costing.LmiRuleScript.PartCount(AssemblyDocument oRefDoc, StreamWriter oWrite, Int32&amp;amp; oCount, Int32&amp;amp; oManuPartCount, Int32&amp;amp; oAssemblyCount, Int32&amp;amp; oFastenerCount, Int32&amp;amp; oComponentCount)&lt;BR /&gt; at Costing.LmiRuleScript.OpTime(Document oRefDoc, StreamWriter oWrite, Int32 Amount)&lt;BR /&gt; at Costing.LmiRuleScript.Main()&lt;BR /&gt; at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;BR /&gt; at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 10:08:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7619644#M78008</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-13T10:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error getting BOMRows</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7619687#M78009</link>
      <description>&lt;P&gt;this works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim oRefDoc As Inventor.AssemblyDocument
oRefDoc = ThisDoc.Document

Dim oAsmComp As &lt;FONT color="#00ff00"&gt;Inventor.AssemblyComponentDefinition&lt;/FONT&gt; = 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&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Dec 2017 10:28:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7619687#M78009</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2017-12-13T10:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error getting BOMRows</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7619950#M78016</link>
      <description>&lt;P&gt;I run this rule in a sequence along with other rules. What I was finding is that it worked just fine when ran on its own. When run in sequence with other it would generate the error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got down to the bottom of which other rule was causing this one to fail. The rule that runs just before this one contained this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AddVbFile "RunAllRulesUnderDocument.txt"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim ruleRunner = New RunAllRulesUnderDocument(iLogicVb, Component, "Base Data.ipt")&lt;BR /&gt;Dim doc = ThisDoc.Document ' This is required (indirectly) by the external rule so that it can use Inventor objects.&lt;/P&gt;
&lt;P&gt;ruleRunner.RunAllRules("Top")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After commenting this out I don't get the error anymore when run in sequence. Any idea why this could cause that error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 12:19:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7619950#M78016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-13T12:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error getting BOMRows</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7620000#M78017</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Be careful with declaring always as "document".&lt;/P&gt;&lt;P&gt;if meant Part than as "partDocument"&lt;/P&gt;&lt;P&gt;If meant Assembly as "Assemblydocument"&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If meant drawing as "DrawingDocument"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This will be&amp;nbsp; the issue I think!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 12:36:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7620000#M78017</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2017-12-13T12:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Error getting BOMRows</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7620402#M78034</link>
      <description>&lt;P&gt;To further elaborate, it has been outlined in a blog by an Autodesk employee that the GENERIC document class does not work with the ComponentDefinition method in all cases, and is prone to issues. It is therefore better to use the specific document type if you are going to be accessing the component definition.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 14:30:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7620402#M78034</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-12-13T14:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error getting BOMRows</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7620611#M78039</link>
      <description>&lt;P&gt;we say toppie, for the explanation!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 15:15:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/7620611#M78039</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2017-12-13T15:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error getting BOMRows</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/9585190#M112178</link>
      <description>&lt;P&gt;This can also happen when there is some missing references in the assembly (on 2021. On 2016, there is no exception thrown).&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 14:33:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-getting-bomrows/m-p/9585190#M112178</guid>
      <dc:creator>FRFR1426</dc:creator>
      <dc:date>2020-06-17T14:33:54Z</dc:date>
    </item>
  </channel>
</rss>

