Hi, I want the co-ordinates of the center of the text of a display dimension with the API. (Show in the green circle below).
Annotaion.GetPosition() works for most cases, however if the DisplayDimension is vertical and has a Broken Leader with Horizontal Text (as seen below), the position returned is where the leader starts (shown in the red circle below).
I am able to get the length of the leader line with DisplayDimension.GetBentLeaderLength and the width of the Dimension with Annotation.Width (I assume), however I cannot get which direction the leader goes. This makes the difference of adding or subtracting the value and the Annotation position to get the text position.
Annotation.GetLeaderSide returns the same value regardless of which side the leader is on. The two cases I am trying to discriminate between are shown below.
I've spent hours looking through the API for the correct method, but I can't find one that works. What method can be used to determine the leader side of a display dimension. Alternatively another method of reliability determining the center of a DisplayDimension's text could be proposed.
Thanks
This problem can be solved by using the DisplayData.
DisplayData = DisplayDimension.GetDisplayData()
X = DisplayData.GetTextPositionAtIndex(0)(0) + DisplayData.GetTextInBoxWidthAtIndex(0) / 2
You may need to iterate through all the items in the index of the display data to get the appropriate bounds for your application.