<?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 Read exported BOM xml file to understand column order in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/read-exported-bom-xml-file-to-understand-column-order/m-p/9678842#M59782</link>
    <description>&lt;P&gt;I am writing a program to export the BOM from an assembly. As I found out the BOM export from an API sorts the columns alphabetically. I would like to sort the columns based on an XML file that is used. I looked at some posts to resort the BOM xlsx file using the Excel reference. However, an array has to be created for the columns to sort by and the posts I viewed manually created the array.&lt;/P&gt;&lt;P&gt;I would like to read the XML file to capture an array dynamically as users typically have different needs. I am able to read the XML file but I'm trying to figure out how to determine the column order in the xml file.&lt;/P&gt;&lt;P&gt;I thought the XML file listed the columns in order and I created a list of column names where visible = true but it doesn't seem to be working as I first thought.&lt;/P&gt;&lt;P&gt;Any info on understanding the XML file would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Aug 2020 11:55:31 GMT</pubDate>
    <dc:creator>J_Dumont</dc:creator>
    <dc:date>2020-08-07T11:55:31Z</dc:date>
    <item>
      <title>Read exported BOM xml file to understand column order</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/read-exported-bom-xml-file-to-understand-column-order/m-p/9678842#M59782</link>
      <description>&lt;P&gt;I am writing a program to export the BOM from an assembly. As I found out the BOM export from an API sorts the columns alphabetically. I would like to sort the columns based on an XML file that is used. I looked at some posts to resort the BOM xlsx file using the Excel reference. However, an array has to be created for the columns to sort by and the posts I viewed manually created the array.&lt;/P&gt;&lt;P&gt;I would like to read the XML file to capture an array dynamically as users typically have different needs. I am able to read the XML file but I'm trying to figure out how to determine the column order in the xml file.&lt;/P&gt;&lt;P&gt;I thought the XML file listed the columns in order and I created a list of column names where visible = true but it doesn't seem to be working as I first thought.&lt;/P&gt;&lt;P&gt;Any info on understanding the XML file would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 11:55:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/read-exported-bom-xml-file-to-understand-column-order/m-p/9678842#M59782</guid>
      <dc:creator>J_Dumont</dc:creator>
      <dc:date>2020-08-07T11:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Read exported BOM xml file to understand column order</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/read-exported-bom-xml-file-to-understand-column-order/m-p/9679619#M59783</link>
      <description>&lt;P&gt;Just checking...Is your end goal the XML file, or do you want to eventually end up with an Excel file?&lt;/P&gt;&lt;P&gt;Are you using a separate XML file as a reference, besides the one you're exporting from the BOM?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 17:44:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/read-exported-bom-xml-file-to-understand-column-order/m-p/9679619#M59783</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-08-07T17:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Read exported BOM xml file to understand column order</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/read-exported-bom-xml-file-to-understand-column-order/m-p/9679655#M59784</link>
      <description>&lt;P&gt;I am exporting my BOM to a spreadsheet vis VB.Net and the columns are alphabetical instead of in the order that I configured. I used the Export function from the BOM so I can quickly change existing files to have the columns I need.&lt;/P&gt;&lt;P&gt;From other posts, it appears that I need to use Excel to sort the columns properly but each post I revied had the columns hardcoded. I have many users with different needs so I have been trying to read the XML file to figure out what columns the user wants and in what order and then I can create the array dynamically.&lt;/P&gt;&lt;P&gt;I think I figured out the XML file. It appears to export the Model Data as&amp;nbsp;&amp;lt;Layout Index="0"&amp;gt;, the Structured as,&amp;nbsp;&amp;lt;Layout Index="1"&amp;gt; and the Parts Only as,&amp;nbsp;&amp;lt;Layout Index="2"&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can then capture the text from each Caption whose Visible = True and the VisibleIndex gives me the order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;property iskey="true" isnull="true" name="Item1"&amp;gt;&lt;BR /&gt;&amp;lt;property name="ImageIndex"&amp;gt;-1&amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;lt;property name="ImageAlignment"&amp;gt;Near&amp;lt;/property&amp;gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;lt;property name="Caption"&amp;gt;Item&amp;lt;/property&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&amp;lt;property name="ToolTip"/&amp;gt;&lt;BR /&gt;&amp;lt;property name="CustomizationCaption"/&amp;gt;&lt;BR /&gt;&amp;lt;property name="FieldName"&amp;gt;Item Order&amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;lt;property name="FieldNameSort"/&amp;gt;&lt;BR /&gt;&amp;lt;property name="Name"&amp;gt;treeListItem Order&amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;lt;property name="AllowIncrementalSearch"&amp;gt;true&amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;lt;property name="Fixed"&amp;gt;None&amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;lt;property name="ColumnEditName"/&amp;gt;&lt;BR /&gt;&amp;lt;property name="ShowButtonMode"&amp;gt;Default&amp;lt;/property&amp;gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;lt;property name="VisibleIndex"&amp;gt;0&amp;lt;/property&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;lt;property name="Visible"&amp;gt;true&amp;lt;/property&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&amp;lt;property name="SortOrder"&amp;gt;None&amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;lt;property name="SortIndex"&amp;gt;-1&amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;lt;property name="SortMode"&amp;gt;Custom&amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;lt;property name="FilterMode"&amp;gt;Value&amp;lt;/property&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if you think I missed anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 18:04:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/read-exported-bom-xml-file-to-understand-column-order/m-p/9679655#M59784</guid>
      <dc:creator>J_Dumont</dc:creator>
      <dc:date>2020-08-07T18:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Read exported BOM xml file to understand column order</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/read-exported-bom-xml-file-to-understand-column-order/m-p/9679711#M59785</link>
      <description>&lt;P&gt;When I export the 'Structured' BOMView using this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oADoc As AssemblyDocument = ThisAssembly.Document
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Dim oBOM As BOM = oADef.BOM
oBOM.StructuredViewEnabled = True
oBOM.StructuredViewFirstLevelOnly = True
Dim oStView As BOMView = oBOM.BOMViews.Item("Structured")
Dim oFileName As String = "C:\Temp\BOM Export to Excel test.xlsx"
Dim oSheetName As String = "BOM"
oStView.Export(oFileName,FileFormatEnum.kMicrosoftExcelFormat,oSheetName)&lt;/LI-CODE&gt;&lt;P&gt;All the columns are the same as they were when I was looking at it within Inventor's BOM dialog.&lt;/P&gt;&lt;P&gt;Even all the thumbnails are in place, and scale with the cell size.&lt;/P&gt;&lt;P&gt;I'm using Inventor Pro 2021.1, Win10 Enterprise, &amp;amp; MS Office 2019.&lt;/P&gt;&lt;P&gt;Here's a screen shot of my Inventor dialog &amp;amp; my Excel sheet.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Inventor BOM View.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/804922iB2EF198BB2911F93/image-size/large?v=v2&amp;amp;px=999" role="button" title="Inventor BOM View.png" alt="Inventor BOM View.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Exported BOM To Excel.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/804923i8859C2FB1C570D44/image-size/large?v=v2&amp;amp;px=999" role="button" title="Exported BOM To Excel.png" alt="Exported BOM To Excel.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 18:33:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/read-exported-bom-xml-file-to-understand-column-order/m-p/9679711#M59785</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-08-07T18:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Read exported BOM xml file to understand column order</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/read-exported-bom-xml-file-to-understand-column-order/m-p/9679801#M59786</link>
      <description>&lt;P&gt;That's great info. Unfortunately, I'm programming using Inventor 2017 as we cannot upgrade for a few months.&lt;/P&gt;&lt;P&gt;I will try my code on a system with the newest release and check the results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I like how you added the sheet name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 19:38:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/read-exported-bom-xml-file-to-understand-column-order/m-p/9679801#M59786</guid>
      <dc:creator>J_Dumont</dc:creator>
      <dc:date>2020-08-07T19:38:42Z</dc:date>
    </item>
  </channel>
</rss>

