.NET

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

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

167 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();
}
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

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