I am a little confused on this piece here.
using (Transaction Trans = Db.TransactionManager.StartTransaction())
{
ObjectIdCollection PurgeIds = GetPurgableIds(Db, Db.BlockTableId );
//ObjectIdCollection PurgeIds = GetPurgableIds(Db, Db.LayerTableId);
int CountIds = PurgeIds.Count;
foreach (ObjectId ObjId in PurgeIds)
{
SymbolTableRecord SymTblRec = Trans.GetObject(ObjId, OpenMode.ForWrite) as SymbolTableRecord;
if (SymTblRec.IsDependent)
--CountIds;
else
{
Ed.WriteMessage("\n Deleted block: {0}", SymTblRec.Name);
SymTblRec.Erase();
}
}
Ed.WriteMessage("\n {0} total number of layers deleted.", CountIds);
}
from Acad
Command: PC2
Deleted block: 3D-TTL-A
I swapped the LayerTableId for BlockTableId. As I step through the code, I see the SymTblRec.Erase() work, yet when its done, the block definition is not purged. Any ideas?