using (Transaction trans = doc.TransactionManager.StartTransaction())
{
BlockTable BlkTab = (BlockTable)trans.GetObject(doc.Database.BlockTableId, OpenMode.ForRead) as BlockTable;
BlockTableRecord btr = (BlockTableRecord)trans.GetObject(BlkTab[BlockTableRecord.ModelSpace], OpenMode.ForRead);
foreach (ObjectId ID in btr)
{
Entity Ent = trans.GetObject(ID,OpenMode.ForRead,true) as Entity;
if (Ent != null)
{
if (Ent is BlockReference)
{
Blk.Color=?????????? //这里怎么写,怎么给块颜色
}
}
}
}