How can I loop through the AttributeReferences for a BlockReference and create an exact copy (looks the same to AutoCAD user) of the AttributeReference as a DBText entity. I’ve seen the code to do this in AutoLisp from the express tools burst.lsp, but I haven’t been able to figure out how to translate it to .Net. Here is the simple code for looping through the Attribute References
foreach (ObjectId attributeReferenceId in blockReference.AttributeCollection)
{
AttributeReference attributeReference = (AttributeReference)transaction.GetObject(attributeReferenceId, OpenMode.ForWrite);
// Make DBText copy
}
To solve this problem I have copied specific properties from the
AttributeReferenceinto a newDBTextobject. Here is the specific code that worked for me to burst a blockreference.SetTextStyleandGetTextStyleare extension methods on theDBTextclass to work with changes between versions of the AutoCAD API.