.NET

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

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

170 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();
}
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.