<?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: BOM EXPORT | EACH ASSEMBLY IN A CSV in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6914960#M70580</link>
    <description>&lt;P&gt;Hi tomas,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please find the following code to export BOM in csv&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument

    ' Set a reference to the BOM
    Dim oBOM As BOM
    Set 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
    Set oStructuredBOMView = oBOM.BOMViews.Item("Structured")
    
    ' Export the BOM view to an Excel file
    oStructuredBOMView.Export "C:\Temp\StructuredBOM.csv", kTextFileCommaDelimitedFormat
&lt;/PRE&gt;
&lt;P&gt;Please free to contact if there is any doubt.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Mar 2017 10:03:12 GMT</pubDate>
    <dc:creator>chandra.shekar.g</dc:creator>
    <dc:date>2017-03-02T10:03:12Z</dc:date>
    <item>
      <title>BOM EXPORT | EACH ASSEMBLY IN A CSV</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6914692#M70578</link>
      <description>&lt;P&gt;Hi Sirs,&lt;/P&gt;&lt;P&gt;Any idea about how to export BOM, but create a new csv for each assembly in the structure?&lt;/P&gt;&lt;P&gt;Of course via API.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 07:29:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6914692#M70578</guid>
      <dc:creator>tpascual</dc:creator>
      <dc:date>2017-03-02T07:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: BOM EXPORT | EACH ASSEMBLY IN A CSV</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6914960#M70580</link>
      <description>&lt;P&gt;Hi tomas,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please find the following code to export BOM in csv&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument

    ' Set a reference to the BOM
    Dim oBOM As BOM
    Set 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
    Set oStructuredBOMView = oBOM.BOMViews.Item("Structured")
    
    ' Export the BOM view to an Excel file
    oStructuredBOMView.Export "C:\Temp\StructuredBOM.csv", kTextFileCommaDelimitedFormat
&lt;/PRE&gt;
&lt;P&gt;Please free to contact if there is any doubt.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 10:03:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6914960#M70580</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2017-03-02T10:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: BOM EXPORT | EACH ASSEMBLY IN A CSV</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6915482#M70581</link>
      <description>&lt;P&gt;vb.net (to use as a rule):&lt;/P&gt;
&lt;PRE&gt;Sub Main()&lt;BR /&gt;    Dim oDoc As Document&lt;BR /&gt;    oDoc = ThisApplication.ActiveDocument&lt;BR /&gt;&lt;BR /&gt;    For Each oSubDoc in oDoc.AllReferencedDocuments&lt;BR /&gt;        If oSubDoc.DocumentType = kAssemblyDocumentObject Then&lt;BR /&gt;            Call ExportDocStructBOM(oSubDoc)&lt;BR /&gt;        End if&lt;BR /&gt;    Next&lt;BR /&gt;&lt;BR /&gt;    MsgBox("Rule Complete!")&lt;BR /&gt;End Sub&lt;BR /&gt;&lt;BR /&gt;Sub ExportDocStructBOM(oDoc As Document) &lt;BR /&gt;
    Dim oBOM As BOM
    oBOM = oDoc.ComponentDefinition.BOM
    
    oBOM.StructuredViewFirstLevelOnly = False
    oBOM.StructuredViewEnabled = True

    Dim oStructuredBOMView As BOMView
    oStructuredBOMView = oBOM.BOMViews.Item("Structured")
    
    oStructuredBOMView.Export("C:\Temp\StructuredBOM.csv", kTextFileCommaDelimitedFormat)&lt;BR /&gt;End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vba:&lt;/P&gt;
&lt;PRE&gt;Sub Main()&lt;BR /&gt;    Dim oDoc As Document&lt;BR /&gt;    Set oDoc = ThisApplication.ActiveDocument&lt;BR /&gt;&lt;BR /&gt;    For Each oSubDoc in oDoc.AllReferencedDocuments&lt;BR /&gt;        If oSubDoc.DocumentType = kAssemblyDocumentObject Then&lt;BR /&gt;            Call ExportDocStructBOM(oSubDoc)&lt;BR /&gt;        End if&lt;BR /&gt;    Next&lt;BR /&gt;&lt;BR /&gt;    Call MsgBox("Rule Complete!")&lt;BR /&gt;End Sub&lt;BR /&gt;&lt;BR /&gt;Sub ExportDocStructBOM(oDoc As Document) &lt;BR /&gt;
    Dim oBOM As BOM
    Set oBOM = oDoc.ComponentDefinition.BOM
    
    oBOM.StructuredViewFirstLevelOnly = False
    oBOM.StructuredViewEnabled = True

    Dim oStructuredBOMView As BOMView
    Set oStructuredBOMView = oBOM.BOMViews.Item("Structured")
    
    Call oStructuredBOMView.Export("C:\Temp\StructuredBOM.csv", kTextFileCommaDelimitedFormat)&lt;BR /&gt;End Sub&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 14:02:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6915482#M70581</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-03-02T14:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: BOM EXPORT | EACH ASSEMBLY IN A CSV</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6915487#M70582</link>
      <description>Hi Chandra,&lt;BR /&gt;Thanks for your response, I have tried yet this code, but what I mean is to export each assembly in the structure to one csv.&lt;BR /&gt;Export first level, and if exist some assembly export too but in a different csv.&lt;BR /&gt;I'm now exporting first level into a csv.&lt;BR /&gt;Thanks,</description>
      <pubDate>Thu, 02 Mar 2017 14:03:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6915487#M70582</guid>
      <dc:creator>tpascual</dc:creator>
      <dc:date>2017-03-02T14:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: BOM EXPORT | EACH ASSEMBLY IN A CSV</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6917670#M70596</link>
      <description>&lt;P&gt;Hi Tomas,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please find the updated code to export BOM in different csv file for each assembly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Main()
    Dim oDoc As Document
    Set oDoc = ThisApplication.ActiveDocument
    
    Call ExportDocStructBOM(oDoc)
    
    Dim oSubDoc As Document

    For Each oSubDoc In oDoc.AllReferencedDocuments
        If oSubDoc.DocumentType = kAssemblyDocumentObject Then
            Call ExportDocStructBOM(oSubDoc)
        End If
    Next

End Sub

Sub ExportDocStructBOM(oDoc As AssemblyDocument)

    Dim oBOM As BOM
    Set oBOM = oDoc.ComponentDefinition.BOM
    
    oBOM.StructuredViewFirstLevelOnly = False
    oBOM.StructuredViewEnabled = True

    Dim oStructuredBOMView As BOMView
    Set oStructuredBOMView = oBOM.BOMViews.Item("Structured")
    
    oStructuredBOMView.Export "C:\Temp\" &amp;amp; oDoc.DisplayName &amp;amp; "_StructuredBOM.csv", kTextFileCommaDelimitedFormat
End Sub&lt;/PRE&gt;
&lt;P&gt;Please feel free to contact if there is any doubt.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 05:15:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6917670#M70596</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2017-03-03T05:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: BOM EXPORT | EACH ASSEMBLY IN A CSV</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6926242#M70657</link>
      <description>&lt;P&gt;Hi Sirs,&lt;/P&gt;&lt;P&gt;I'm not yet tested, but it seems to work.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 12:00:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6926242#M70657</guid>
      <dc:creator>tpascual</dc:creator>
      <dc:date>2017-03-07T12:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: BOM EXPORT | EACH ASSEMBLY IN A CSV</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6970151#M71127</link>
      <description>&lt;P&gt;Great ¡¡¡&lt;/P&gt;&lt;P&gt;Now I'm trying to process only assemblies in Estructured BOM not in all document.&lt;/P&gt;&lt;P&gt;I have phantom ass.&lt;/P&gt;&lt;P&gt;Any idea wellcome.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 09:49:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/bom-export-each-assembly-in-a-csv/m-p/6970151#M71127</guid>
      <dc:creator>tpascual</dc:creator>
      <dc:date>2017-03-24T09:49:39Z</dc:date>
    </item>
  </channel>
</rss>

