<?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: List all ItemNumbers, in all levels. in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/list-all-itemnumbers-in-all-levels/m-p/9389264#M107121</link>
    <description>&lt;P&gt;You've just got to dig deeper.&amp;nbsp; Under your For Each oBOMRow line, check the oBOMRow.ChildRows.Count to see if it is greater than zero.&lt;/P&gt;&lt;P&gt;You could also check the oBOMRow.ReferencedFileDescriptor.ReferencedFileType, to see if it is a Part or Assembly.&lt;/P&gt;&lt;P&gt;Or you could do this a different way by:&lt;/P&gt;&lt;P&gt;Dim oRowDoc As Document = oBOMRow.ComponentDefinitions.Item(1).Document&lt;/P&gt;&lt;P&gt;If oRowDoc.DocumentType =&lt;/P&gt;&lt;P&gt;Keep in mind that BOM rows can also be "Merged", "Promoted", or "RolledUp", too.&lt;/P&gt;&lt;P&gt;You may need to check for these, if you have any of that going on within your BOM.&lt;/P&gt;</description>
    <pubDate>Fri, 20 Mar 2020 11:16:51 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2020-03-20T11:16:51Z</dc:date>
    <item>
      <title>List all ItemNumbers, in all levels.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/list-all-itemnumbers-in-all-levels/m-p/9388981#M107119</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to list all (Structured) ItemNumbers in all levels/subassemblies just like inventor does:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BOMStructured.gif" style="width: 82px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/743406i48E4123A6E904D8F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BOMStructured.gif" alt="BOMStructured.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;however using my code I only get the first level (so 4.1 is not added to the array).&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Public Sub GetPtLevels()
   Dim LevelList As List(Of String)
        objapprenticeServerApp = Marshal.GetActiveObject("Inventor.Application")

        Dim doc As Document = objapprenticeServerApp.ActiveDocument
        Dim oAssyDef As AssemblyComponentDefinition = doc.ComponentDefinition
        Dim oBOM As BOM = oAssyDef.BOM
        oBOM.StructuredViewFirstLevelOnly = False

        Dim oBOMView As BOMView = oBOM.BOMViews.Item("Structured")
        Dim oBOMRow As BOMRow

        For Each oBOMRow In oBOMView.BOMRows
            LevelList.Add(oBOMRow.ItemNumber)
        Next
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 08:01:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/list-all-itemnumbers-in-all-levels/m-p/9388981#M107119</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-20T08:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: List all ItemNumbers, in all levels.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/list-all-itemnumbers-in-all-levels/m-p/9389264#M107121</link>
      <description>&lt;P&gt;You've just got to dig deeper.&amp;nbsp; Under your For Each oBOMRow line, check the oBOMRow.ChildRows.Count to see if it is greater than zero.&lt;/P&gt;&lt;P&gt;You could also check the oBOMRow.ReferencedFileDescriptor.ReferencedFileType, to see if it is a Part or Assembly.&lt;/P&gt;&lt;P&gt;Or you could do this a different way by:&lt;/P&gt;&lt;P&gt;Dim oRowDoc As Document = oBOMRow.ComponentDefinitions.Item(1).Document&lt;/P&gt;&lt;P&gt;If oRowDoc.DocumentType =&lt;/P&gt;&lt;P&gt;Keep in mind that BOM rows can also be "Merged", "Promoted", or "RolledUp", too.&lt;/P&gt;&lt;P&gt;You may need to check for these, if you have any of that going on within your BOM.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 11:16:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/list-all-itemnumbers-in-all-levels/m-p/9389264#M107121</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-03-20T11:16:51Z</dc:date>
    </item>
  </channel>
</rss>

