In Autocad I'm programmatically settign the alignment of an attribute to MiddleCenter. Looking at the attribute I can see that the alignment is set properly. However, the alignment does visually update itself.
I'm able to manually update the allignment if I open the Enhanced Attribute Editor and make any change. If any property is updated, the attribute "realizes" it needs to update the alignment.
How can I make AutoCAD automatically update the alignment? Here is a current snippet of my code. In this particular instance "result" will contain 004 as a string:
attribute.TextString = result
attribute.Alignment = AcAlignment.acAlignmentMiddleCenter
attribute.Update()
Which attribute object has the RecordGraphicsModified function? Currently I'm using the Autodesk.AutoCAD.Interop.Common.AcadAttributeReference object, but it doesn't seem to contain the function RecordGraphicsModified().
Hi,
There is no RecordGraphicsModified in Interop. As for the problem, may be a call to Attsync do the trick.
Gaston Nunez
Found a solution for interop. I had programmatically just opened another sheet in the background, retrieved info, then closed it before adding text to this attribute. That seems to have caused my issue. By setting the current sheet to active again the text was inserted with the proper alignment.