TheSwamp

Code Red => .NET => Topic started by: T.Willey on July 26, 2006, 02:51:02 PM

Title: Search all layouts
Post by: T.Willey on July 26, 2006, 02:51:02 PM
Would this work?  Am I on the right path?  If not, can someone point me in the right direction.
Code: [Select]
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?
Code: [Select]
(BlockTableRecordId)dbTrans.GetObject(AcadDb.Lout.BlockTableRecordId, OpenMode.ForRead);

Thanks in advance for any pointers/comments/help.