I am trying to write a command that will extract the Bill of materials data out of an Autocad Mechanical drawing. It can be done in Autocad Mechanica , but I'd like to automate it.
[Link on how to do it in Autocad
The code extract below finds the Parts List object (a table of the bill of materials), but I cannot find how to extract its data.
The ACMPARTLIST looks like a table, but it cannot be extracted using the autocad command TableExport, or DataExtraction.
DBObjectCollection objs = new DBObjectCollection();
Document doc = AcadApp.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
using (Transaction tr = db.TransactionManager.StartTransaction())
bt = tr.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
btr = tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead) as BlockTableRecord;
ObjectIdCollection ids = new ObjectIdCollection();
foreach (ObjectId id in btr)
if (id.ObjectClass.DxfName == "ACMPARTLIST")
What I have tried:
I have tried the solution on these websites, but it applies to a different object.