Author Topic: Search all layouts  (Read 2460 times)

0 Members and 1 Guest are viewing this topic.


  • Needs a day job
  • Posts: 5251
Search all layouts
« 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
public Xref()
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.

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.