BlockTableRecord btr = trans.GetObject(blockId, OpenMode.ForRead) as BlockTableRecord;
string tag = string.Empty;
if (btr.HasAttributeDefinitions)
{
foreach (ObjectId id in btr)
{
DBObject ent = trans.GetObject(id, OpenMode.ForRead) as DBObject;
if (ent is AttributeDefinition)
{
AttributeDefinition attdef = ent as AttributeDefinition;
tag = attdef.Tag;
}
}
}
自己解决了。。 留给后来人参考下 如果有更好的方法也请指导。。