I was waiting until I returned home to post about BLOCK_BEGIN but I see Tim beat me to it. This is a typical culprit when a layer will not purge.
Some code to ponder:
// Modal Command with localized name
[CommandMethod("TCGS", "ListBlockHeaders", "ListBlockHeadersLocal", CommandFlags.Modal)]
public void ListBlockHeadersCommand()
{
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
using (Transaction tr = doc.TransactionManager.StartTransaction())
{
BlockTable bt = tr.GetObject(db.BlockTableId, OpenMode.ForRead, false) as BlockTable;
foreach (ObjectId btrId in bt)
{
BlockTableRecord btr = tr.GetObject(btrId, OpenMode.ForRead, false) as BlockTableRecord;
BlockBegin btrBegin = tr.GetObject(btr.BlockBeginId, OpenMode.ForRead, false) as BlockBegin;
BlockEnd btrEnd = tr.GetObject(btr.BlockEndId, OpenMode.ForRead, false) as BlockEnd;
ed.WriteMessage("{0}Block name: {1}{0}\tBlockBegin Layer: {2}{0}\tBlockEnd Layer: {3}",
Environment.NewLine, btr.Name, btrBegin.Layer, btrEnd.Layer);
}
tr.Commit();
}
}