.NET

.NET

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

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

173 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();
}
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.