DrawingDimension text position

DrawingDimension text position

tobias_wiesendanger
Advocate Advocate
218 Views
2 Replies
Message 1 of 3

DrawingDimension text position

tobias_wiesendanger
Advocate
Advocate

Is there a way to determine if the drawing dimension text is on the left, in the middle or on the right? Of course this can be done with math, but it becomes dificult when the dimensions are not horizontal or vertical but aligned in certains angles. I could not find a way that worked in all situations, mainly because the direction I used changed and left / right switched. Startpoint and endpoint of a dimension for example can switch depending on the situation. The same is true for the direction of the dimension line.

 

2023-10-11 16_47_18-Autodesk Inventor Professional 2022.png

0 Likes
219 Views
2 Replies
Replies (2)
Message 2 of 3

A.Acheson
Mentor
Mentor

Hi @tobias_wiesendanger 

 

Middle is relatively easy getting the mid distance between the two intent points, figuring out if you want it on the left or right is a user decision so what factors make this decision in the code?  

 

In relatively simple horizontal and vertical dims scenarios I have just placed a block of code in to determine the direction required based on two face being left or right of center and then adjust the text offsets + or -accordingly. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 3

tobias_wiesendanger
Advocate
Advocate

Its not like I have to place dimension. Im just iterating over all of them and I need to know where the text is. I think I found a solution for it. It is possible to assume that the smaller x-koordinate of a dimensionLine is on the left. So its possible to check if drawingDim.Dimensionline.Startpoint > drawingDim.Dimensionline.Endpoint and if yes just switch the points. This then allows to have the same situation every time. It no longer matters what angle the dimension has. From there its just checkin if drawingDim.Text.Origin is left, right of those points.

0 Likes