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;
}
}
}