Would this work? Am I on the right path? If not, can someone point me in the right direction.
using System;
using System.Runtime.InteropServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;
using AcadDb = Autodesk.AutoCAD.DatabaseServices;
using dbTrans = AcadDb.TransactionManager;
namespace Test
{
/// <summary>
/// Description of Xref.
/// </summary>
public class Xref
{
[Autodesk.AutoCAD.Runtime.CommandMethod("GetXref-C#")]
public Xref()
{
dbTrans.StartTransaction();
LayoutCol = AcadDb.LayoutManager;
foreach (Layout Lout in LayoutCol)
foreach (ObjectId ObjId in Lout.BlockTableRecordId)
}
}
}
Do I have to open each layout's block for read? If so how to do it? Would this work after the second foreach?
(BlockTableRecordId)dbTrans.GetObject(AcadDb.Lout.BlockTableRecordId, OpenMode.ForRead);
Thanks in advance for any pointers/comments/help.