"When using COM Interop, I am not able to extract the prompt attribute, which I guess would otherwise be possible through the AttributeDefinition object (in-process - AttributeDefinition.prompt). I am using AcadAttributeReference to get tag and text properties." |
Am I doing something wrong here?
...
AcadDocument doc = app.ActiveDocument;
foreach (AcadBlock block in doc.Blocks)
{
foreach (AcadEntity ent in block)
{
AcadAttribute att = ent as AcadAttribute;
if (att != null)
{
doc.Utility.Prompt("\n" +
att.TextString + "," +
att.TagString + "," +
att.PromptString);
}
}
}
Dim objAcAppCom As AcadApplication Dim objDwg As AcadDocument Dim objEntity As AcadEntity Dim objAtt1 As AcadAttribute Dim objBlock As AcadBlock Dim objFile As System.IO.File Dim objWrite As System.IO.StreamWriter Dim objBlockRef As AcadBlockReference Dim objAtt As AcadAttributeReference ............ ............ For Each objBlock In objDwg.Blocks For Each objEntity In objBlock If objEntity.ObjectName.ToString = "AcDbBlockReference" Then objBlockRef = objEntity vAtts = objBlockRef.GetAttributes For i = 0 To UBound(vAtts) objAtt = vAtts(i) console.writeline(objAtt.TextString) Next End If Next Next |