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
Which attribute object has the RecordGraphicsModified function? Currently I'm using the Autodesk.AutoCAD.Interop.Common.AcadAttributeR
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.
Access a broad range of knowledge to help get the most out of your products and services.
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.
Upgrading to a 2015 product? Make sure to check these out 1st!