<?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 : Autocad mechanical - automatic Parts List extraction (C#) in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6379450#M35792</link>
    <description>&lt;P&gt;I added the starting dot, but it does not create any file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the path i chose (just a temp path for testing). I also tried it without the .csv in FullPAtheName and that didnt work either.&lt;/P&gt;&lt;P&gt;Would anything in this stop it working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;string FullPatheName = @"C:\BOM Out.csv";&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any links to other examples?&lt;/P&gt;&lt;P&gt;I have searhed through alot of other posts but cannot find any.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Jun 2016 22:33:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-06-12T22:33:58Z</dc:date>
    <item>
      <title>Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6374100#M35788</link>
      <description>&lt;P&gt;I am trying to access the Parts List created by Autocad Mechanical.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It can be done manually in Autocad Mechanical , but I'd like to automate it.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://knowledge.autodesk.com/support/autocad-mechanical/getting-started/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-Mechanical/files/GUID-BF5B4EB2-D6BF-4ED0-B7D0-99744661A596-htm.html" target="_blank"&gt;Link to manually extract the parts list&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://m.arch-pub.com/Extract-BOM-data-from-dwg_10439242.html" target="_blank"&gt;I found this code in VBA&lt;/A&gt;, which&amp;nbsp;I could convert to C#, but i do not have &lt;A href="https://forums.autodesk.com/autodesk/attachments/autodesk/152/21287/1/MCAD%20Ref.JPG" target="_blank"&gt;AtuoDesk McadAuto Type Library&lt;/A&gt;, even though I have Autocad Mechanical Installed. I have tried to find it, but have had no success.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I looked at the&amp;nbsp;&lt;A href="http://usa.autodesk.com/adsk/servlet/index?siteID=123112&amp;amp;id=14952981&amp;amp;_ga=1.18036217.111391420.1436844970" target="_blank"&gt;Developer Guide for AutoCAD Mechanical&lt;/A&gt;, but this did not seem to help&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code below finds the parts list in the attached drawing file, but i cannot find what to do to read the parts list.&lt;/P&gt;&lt;PRE&gt;DBObjectCollection objs = new DBObjectCollection();
Document doc = AcadApp.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
ObjectId Id;
 
using (Transaction tr = db.TransactionManager.StartTransaction())
{
    BlockTable bt;
    bt = tr.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
 
    BlockTableRecord btr;
    btr = tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead) as BlockTableRecord;
    ObjectIdCollection ids = new ObjectIdCollection();
 
    foreach (ObjectId id in btr)
    {
        if (id.ObjectClass.DxfName == "ACMPARTLIST")
        {
            // code to read data from parts list

        }
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The ACMPARTLIST looks like a table, but it cannot be extracted using the autocad command TableExport, or DataExtraction.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have tried other suggestions. This one extracts tables, but&amp;nbsp;&lt;SPAN&gt;ACMPARTLIST is not a table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/net/extracting-bom-from-autocad-using-c/m-p/3873852#M34623" target="_blank"&gt;http://forums.autodesk.com/t5/net/extracting-bom-from-autocad-using-c/m-p/3873852#M34623&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do i need the McadAuto.dll so I can access the BOM, or am i missing something else?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 06:06:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6374100#M35788</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-09T06:06:39Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6374182#M35789</link>
      <description>&lt;P&gt;You need to add a reference to MCadAuto and SymBBAuto library (they are in C:\Program Files\Common Files\Autodesk Shared), then you can access the parts list with code like this (not tested):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Set mcad = app&lt;/SPAN&gt;&lt;SPAN&gt;.GetInterfaceObject("AcadmAuto.AcadmApplication&lt;/SPAN&gt;&lt;SPAN&gt;")&lt;/SPAN&gt;&lt;BR /&gt;Dim oSymBB As McadSymbolBBMgr = mcad.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr")
Dim oBOMMgr As McadBOMMgr = oSymBB.BOMMgr
If oBOMMgr.BOMTableExists("testBOM") Then
  Set oBOM As McadBOM = oBOMMgr.GetBOMTable(doc.ModelSpace, "testBOM")&lt;BR /&gt;  // See documentation for McadBOM to see what you can do with that&lt;BR /&gt;  // http://usa.autodesk.com/adsk/servlet/index?siteID=123112&amp;amp;id=14952981
End If

&lt;/PRE&gt;
&lt;P&gt;Please note that it is recommended to put the version in the ProgId (AcadmAuto.AcadmApplication.5 for AutoCAD 2016 for example)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 07:23:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6374182#M35789</guid>
      <dc:creator>FRFR1426</dc:creator>
      <dc:date>2016-06-09T07:23:59Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6376380#M35790</link>
      <description>&lt;P&gt;Thanks for that, they were there all along with a slightly different name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The link you gave did not work. I tried searching for something similar, but i cannot find how to read the parts list data of each item in the parts list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my current code.&lt;/P&gt;&lt;P&gt;It finds the BOM table (Always called MAIN).&lt;/P&gt;&lt;P&gt;I tried&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                 SymBBAuto.IMcadSymbolBBMgr symbbmgr;
                    symbbmgr = acApp.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr");

                    SymBBAuto.IMcadBOMs cadBOMs;
                    cadBOMs = symbbmgr.BOMMgr.GetAllBOMTables(false);

                    SymBBAuto.IMcadBOM cadBOM;
                    cadBOM = cadBOMs.Item(0);

                    SymBBAuto.IMcadBOMMgr cadBOMmgr;
                    cadBOMmgr = symbbmgr.BOMMgr;

                    if (cadBOMmgr.BOMTableExists("MAIN"))
                    {
                        cadBOMmgr.ExportBOM(cadBOM, "csv", FullPatheName); // doesnt do anything

                        IMcadBOMItems bomItems = cadBOM.Items;
                        object oItem;
                        foreach (McadBOMItem bomItem in bomItems)
                        {
                            // add code to read parts list data
                        }
                    }&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to export the BOM, which did not work.&lt;/P&gt;&lt;P&gt;I also tried to export the parts list from the BOM, which&amp;nbsp;gave me the error "the file being exported to cannot be created"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                        McadBOMMgr cadBOMmgr2;
                        cadBOMmgr2 = symbbmgr.BOMMgr as McadBOMMgr;
                        McadPartLists PL;
                        PL = cadBOM.PartLists;
                        cadBOMmgr2.ExportPartList(McadBOMExportFormatType.exCSV, PL.Item(0), FullPathName, "MAIN", true);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to go through each bom item and extract its data, but i could notfind how to get this data&lt;/P&gt;&lt;PRE&gt;                        IMcadBOMItems bomItems = cadBOM.Items;
                        object oItem;
                        foreach (McadBOMItem bomItem in bomItems)
                        {
                            // add code to get item of each bom item
                        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any advice/links on how to get any of them to work, that would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 04:57:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6376380#M35790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-10T04:57:54Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6376545#M35791</link>
      <description>&lt;P&gt;FileType should be .csv (starting with a dot).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;cadBOMmgr.ExportBOM(cadBOM, ".csv", FullPatheName);&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jun 2016 07:30:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6376545#M35791</guid>
      <dc:creator>FRFR1426</dc:creator>
      <dc:date>2016-06-10T07:30:34Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6379450#M35792</link>
      <description>&lt;P&gt;I added the starting dot, but it does not create any file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the path i chose (just a temp path for testing). I also tried it without the .csv in FullPAtheName and that didnt work either.&lt;/P&gt;&lt;P&gt;Would anything in this stop it working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;string FullPatheName = @"C:\BOM Out.csv";&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any links to other examples?&lt;/P&gt;&lt;P&gt;I have searhed through alot of other posts but cannot find any.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 22:33:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6379450#M35792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-12T22:33:58Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6437376#M35793</link>
      <description>&lt;P&gt;I still cannot get this to work, this is my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        public static void Extract_BOM()
        {
            string FullPathName = @"C:\BOM Out.csv";            

            DBObjectCollection objs = new DBObjectCollection();
            Document doc = AcadApp.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;
            string BomName = "MAIN";

            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                AcadApplication acApp = null;
                const string progID = "AutoCAD.Application.19";
                acApp = (AcadApplication)Marshal.GetActiveObject(progID);
                if (acApp != null)
                {

                    SymBBAuto.IMcadSymbolBBMgr symbbmgr;
                    symbbmgr = acApp.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr");

                    AXDBLib.AcadObject obj;   //requires AXDBlib reference
                    LayoutManager LM = LayoutManager.Current;
                    SymBBAuto.IMcadBOMMgr cadBOMmgr;
                    cadBOMmgr = symbbmgr.BOMMgr;

                    try
                    {
                        obj = (AXDBLib.AcadObject)LM.GetLayoutId(LM.CurrentLayout).GetObject(OpenMode.ForRead).AcadObject;
                        //  sheetSetMgr.GetSheetFromLayout(obj, out sheet);
                        if (cadBOMmgr.BOMTableExists(BomName))
                        {
                            SymBBAuto.IMcadBOM cadBOM;

                            cadBOMmgr.ExportBOM(cadBOM, ".csv", FullPathName);
                        }
                        }
                        catch (System.Exception e)
                        {
                            System.Windows.Forms.MessageBox.Show("There was an error getting the sheet set info for this layout: " + e.Message);
                        }                  
                }
            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The line&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;cadBOMmgr.ExportBOM(cadBOM, ".csv", FullPathName);&lt;/PRE&gt;&lt;P&gt;Gives me the error "There was an error getting the sheet set info for this layout: Error HRESULT E_FAIL has been returned from a call to a COM component.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried a few methods as previously stated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any links where I can view working code, so I can work backwards from it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2016 03:36:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6437376#M35793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-15T03:36:18Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6456737#M35794</link>
      <description>&lt;P&gt;Try the direct interface to AcadApplication instead of using Marshal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;AcadApplication acApp = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt;AcadDocument acDoc = acApp.ActiveDocument&lt;/PRE&gt;&lt;P&gt;I found this works better in .net than using the COM interface.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may also need to add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Using Autodesk.AutoCAD.Interop;
Using Autodesk.AutoCAD.Interop.Common;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jul 2016 02:01:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6456737#M35794</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-25T02:01:09Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6456787#M35795</link>
      <description>&lt;P&gt;Okay, I got it working in VB.net. First thing to note is the COM library has Interface and Non-Interface variables. Once you have an Interface variable you want to save it to a non-Interface type variable and then dispose of the interface.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found that using SymBBAuto.IMcadBOM would throw an error about not being able to write while SymBBAuto.McadBOM wrote the file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim FullPathName As String = "c:\test\test.csv"
Dim BomName As String = "MAIN"

Dim acadApp As AcadApplication = Application.AcadApplication
Dim acadDoc As AcadDocument = acadApp.ActiveDocument

' --------------------------------------------------------------
' Get the Surface Texture Library Object
Try
	' Get Interface to SymbolBBMMgr
	Dim I_symBBmgr3 As IMcadSymbolBBMgr3 = Nothing
	I_symBBmgr3 = acadDoc.Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr") 

	' Get Interface to BOMMgr from the active document
	Dim I_cadBOMmgr3 As SymBBAuto.IMcadBOMMgr3 = Nothing
	I_cadBOMmgr3 = I_symBBmgr3.BOMMgr(acadDoc)

	' Save the Contents to Non-Interface variable
	Dim cadBOMmgr As SymBBAuto.McadBOMMgr = Nothing
	cadBOMmgr = I_cadBOMmgr3

	' Dispose of the Interface
	I_cadBOMmgr3 = Nothing

	' Check if BOMName exists in Table
	If cadBOMmgr.BOMTableExists(BomName) Then
		' Get the BOMTable by name (Non-Interface Variable)
		Dim cadBom As SymBBAuto.McadBOM = Nothing
		cadBom = cadBOMmgr.GetBOMTableByName(BomName)

		If cadBom IsNot Nothing Then
			cadBOMmgr.ExportBOM2(SymBBAuto.McadBOMExportFormatType.exCSV, cadBom, FullPathName, "Main", True)
		End If
	End If

Catch acEx As Autodesk.AutoCAD.Runtime.Exception
	' Write Error Message
Catch ex As System.Exception
	' Write Error Message
End Try&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should be fairly easy to translate to C# if that is what you need. If you are going from VBA, I would suggest VB.net instead of C#.net because it's a little less of a learning curve. However, most people do use C# so it's all up to you on which one to use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 03:03:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6456787#M35795</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-25T03:03:44Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6466036#M35796</link>
      <description>&lt;P&gt;Here is the c# version:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;string FullPathName = "c:\\test\\test.csv";
string BomName = "MAIN";

AcadApplication acadApp = Application.AcadApplication;
AcadDocument acadDoc = acadApp.ActiveDocument;

// --------------------------------------------------------------
// Get the Surface Texture Library Object
try
{
    // Get Interface to SymbolBBMMgr
    IMcadSymbolBBMgr3 I_symBBmgr3 = null;
    I_symBBmgr3 = acadDoc.Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr");

    // Get Interface to BOMMgr from the active document
    SymBBAuto.IMcadBOMMgr3 I_cadBOMmgr3 = null;
    I_cadBOMmgr3 = I_symBBmgr3.BOMMgr(acadDoc);

    // Save the Contents to Non-Interface variable
    SymBBAuto.McadBOMMgr cadBOMmgr = null;
    cadBOMmgr = I_cadBOMmgr3;

    // Dispose of the Interface
    I_cadBOMmgr3 = null;

    // Check if BOMName exists in Table
    if (cadBOMmgr.BOMTableExists(BomName))
    {
        // Get the BOMTable by name (Non-Interface Variable)
        SymBBAuto.McadBOM cadBom = null;
        cadBom = cadBOMmgr.GetBOMTableByName(BomName);

        if (cadBom != null)
        {
            cadBOMmgr.ExportBOM2(SymBBAuto.McadBOMExportFormatType.exCSV, cadBom, FullPathName, "Main", true);
        }
    }
}
catch (Autodesk.AutoCAD.Runtime.Exception acEx)
{
    // Write Error Message
}
catch (System.Exception ex)
{
    // Write Error Message
}&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jul 2016 00:23:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6466036#M35796</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-29T00:23:49Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6521624#M35797</link>
      <description>&lt;P&gt;Did the C# code compile for you?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I received the following errors;&lt;/P&gt;&lt;P&gt;I tried to fix it, but couldn't get it to work.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Error CS1955 Non-invocable member 'IMcadSymbolBBMgr3.BOMMgr[object]' cannot be used like a method.&lt;/P&gt;&lt;P&gt;Error CS0266 Cannot implicitly convert type 'SymBBAuto.IMcadBOMMgr3' to 'SymBBAuto.McadBOMMgr'. An explicit conversion exists (are you missing a cast?)&lt;/P&gt;&lt;P&gt;Error CS0266 Cannot implicitly convert type 'SymBBAuto.IMcadBOM' to 'SymBBAuto.McadBOM'. An explicit conversion exists (are you missing a cast?)&amp;nbsp;&lt;BR /&gt;Error CS0266 Cannot implicitly convert type 'object' to 'Autodesk.AutoCAD.Interop.AcadApplication'. An explicit conversion exists (are you missing a cast?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 04:22:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6521624#M35797</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-25T04:22:11Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6521674#M35798</link>
      <description>&lt;P&gt;Unfortunately I hadn't tested the C# code. All my development in Autocad has been with VB. All my C# experience comes from my development with CATIA which has mostly been at the COM level. Try these fixes, they should help a bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Error CS1955 Non-invocable member 'IMcadSymbolBBMgr3.BOMMgr[object]' cannot be used like a method.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The VB intellisense shows that it's needed but the Object Browser shows the param as optional. Try removing the acadDoc from the line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;I_cadBOMmgr3 = I_symBBmgr3.BOMMgr;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This line also has another error with the solution below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Error CS0266 Cannot implicitly convert type 'SymBBAuto.IMcadBOMMgr3' to 'SymBBAuto.McadBOMMgr'. An explicit conversion exists (are you missing a cast?)&lt;P&gt;Error CS0266 Cannot implicitly convert type 'SymBBAuto.IMcadBOM' to 'SymBBAuto.McadBOM'. An explicit conversion exists (are you missing a cast?)&amp;nbsp;&lt;BR /&gt;Error CS0266 Cannot implicitly convert type 'object' to 'Autodesk.AutoCAD.Interop.AcadApplication'. An explicit conversion exists (are you missing a cast?)&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;These should be able to be fixable by explicitly casting; something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;I_symBBmgr3 = (IMcadSymbolBBMgr3)acadDoc.Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr");


I_cadBOMmgr3 = (SymBBAuto.IMcadBOMMgr3)I_symBBmgr3.BOMMgr;


cadBOMmgr = (SymBBAuto.McadBOMMgr)I_cadBOMmgr3;&lt;/PRE&gt;&lt;P&gt;That will explicitly cast the objects and should hopefully fix them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know how it goes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 05:31:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6521674#M35798</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-25T05:31:05Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6521686#M35799</link>
      <description>&lt;P&gt;Scratch some of that previous post, the first error wasn't happening in the spot I thought it was. Compiled, and tested C# code is as follows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using System;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;
using SymBBAuto;
using Autodesk.AutoCAD.Interop;


// This line is not mandatory, but improves loading performances
[assembly: CommandClass(typeof(TESTER.MyCommands))]

namespace TESTER
{
    public class MyCommands
    {
        // Modal Command with localized name
        [CommandMethod("TTT", "TTT", CommandFlags.Modal)]
        public void TTT() // This method can have any name
        {
            string FullPathName = "c:\\temp\\test.csv";
            string BomName = "MAIN";

            AcadApplication acadApp = (AcadApplication)Application.AcadApplication;
            AcadDocument acadDoc = acadApp.ActiveDocument;

            try
            {
                // Get Interface to SymbolBBMMgr
                IMcadSymbolBBMgr3 I_symBBmgr3 = null;
                I_symBBmgr3 = (IMcadSymbolBBMgr3)acadDoc.Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr");

                // Get Interface to BOMMgr from the active document
                SymBBAuto.IMcadBOMMgr3 I_cadBOMmgr3 = null;
                I_cadBOMmgr3 = (SymBBAuto.IMcadBOMMgr3)I_symBBmgr3.BOMMgr;

                // Save the Contents to Non-Interface variable
                SymBBAuto.McadBOMMgr cadBOMmgr = null;
                cadBOMmgr = (SymBBAuto.McadBOMMgr)I_cadBOMmgr3;

                // Dispose of the Interface
                I_cadBOMmgr3 = null;

                // Check if BOMName exists in Table
                if (cadBOMmgr.BOMTableExists(BomName))
                {
                    // Get the BOMTable by name (Non-Interface Variable)
                    SymBBAuto.McadBOM cadBom = null;
                    cadBom = (SymBBAuto.McadBOM)cadBOMmgr.GetBOMTableByName(BomName);

                    if (cadBom != null)
                    {
                        cadBOMmgr.ExportBOM2(SymBBAuto.McadBOMExportFormatType.exCSV, cadBom, FullPathName, "Main", true);
                    }
                }
            }
            catch (Autodesk.AutoCAD.Runtime.Exception acEx)
            {
                // Write Error Message
            }
            catch (System.Exception ex)
            {
                // Write Error Message
            }
        }
    }
}&lt;/PRE&gt;&lt;P&gt;Do note the output directory "FullPathName" must be an actual location. The export doesn't seem to want to create folders. The file it creates okay, however.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 05:54:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6521686#M35799</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-25T05:54:00Z</dc:date>
    </item>
    <item>
      <title>Re : Autocad mechanical - automatic Parts List extraction (C#)</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6523860#M35800</link>
      <description>&lt;P&gt;I see where i went wrong.&lt;/P&gt;&lt;P&gt;Makes sense, and worked perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for the help.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 22:10:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-mechanical-automatic-parts-list-extraction-c/m-p/6523860#M35800</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-25T22:10:04Z</dc:date>
    </item>
  </channel>
</rss>

