.NET

Reply
Member
Posts: 3
Registered: ‎10-19-2005
Message 1 of 1 (156 Views)

how to get all objects in BlockTableRecord,inclluding the erased objects

156 Views, 0 Replies
09-13-2006 07:15 PM
I use these codes to enumerate the objects,but can't get the erased objects.Please help me.
Database db = HostApplicationServices.WorkingDatabase;
Transaction trans = db.TransactionManager.StartTransaction();
try
{
BlockTable bt = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForRead);
BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead,true);
bt.Dispose();

BlockTableRecordEnumerator iter = btr.GetEnumerator();

while (iter.MoveNext())
{
Entity ent = trans.GetObject(iter.Current, OpenMode.ForWrite, true) ;
}
catch
{
}
finally
{
trans.Dispose();
}

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community