[CommandMethod("doit", CommandFlags.NoUndoMarker)]
public void CreateTableFormul()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
ObjectId ModelSpaceId = SymbolUtilityServices.GetBlockModelSpaceId(db);
using (BlockTableRecord btr = ModelSpaceId.Open(OpenMode.ForRead) as BlockTableRecord)
{
db.DisableUndoRecording(true);
foreach(var id in btr)
{
using(Entity ent = id.Open(OpenMode.ForWrite) as Entity)
{
ent.Layer = "0";
}
}
db.DisableUndoRecording(false);
}
}