foreach (ObjectId id in btr)
{
//пытаемся открыть объект как описание атрибута
using (AttributeDefinition attr = tr.GetObject(id, OpenMode.ForRead, false, true) as AttributeDefinition)
{
//если это атрибут и он не константа
if (attr == null || attr.Constant) continue;
//создаем вставку атрибута
using (AttributeReference attrRef = new AttributeReference())
{
//добавляем в блок
attrRef.SetAttributeFromBlock(attr, br.BlockTransform);
br.AttributeCollection.AppendAttribute(attrRef);
tr.AddNewlyCreatedDBObject(attrRef, true);
//дублируем после добавления что бы нормально отрабатывали вставки полей
attrRef.SetAttributeFromBlock(attr, br.BlockTransform);
}
}
}