That's what I was thinking...or you could go this way as well:
[CommandMethod("TCGS", "IterateLayouts", "IterateLayoutsLocal", CommandFlags.Modal)]
public void MyCommand()
{
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
DBDictionary layoutDict = (DBDictionary)tr.GetObject(db.LayoutDictionaryId, OpenMode.ForRead, false);
foreach (DBDictionaryEntry layoutDictEnt in layoutDict)
{
doc.Editor.WriteMessage("{0}Layout name: {1}", Environment.NewLine, layoutDictEnt.Key);
Layout layout = (Layout)tr.GetObject(layoutDictEnt.Value, OpenMode.ForRead, false);
// grab the block table record for the layout as this will have
// every graphical entity in it...
BlockTableRecord layoutBTR = (BlockTableRecord)tr.GetObject(layout.BlockTableRecordId, OpenMode.ForRead, false);
// loop the BTR...
foreach (ObjectId btrEntId in layoutBTR)
{
Entity ent = (Entity)tr.GetObject(btrEntId, OpenMode.ForRead, false);
Type entType = ent.GetType();
doc.Editor.WriteMessage("{0}Entity type: {1}", Environment.NewLine, entType);
}
}
tr.Commit();
}
}
bear in mind that with these methodologies, you will miss 'nested' blocks...