Automatic replacement of overlapping dimension text

Hi,
Im placing multiple dimensions automaticcaly and want to move texts that are overlapping. The node Dimension.SetTextLocation is no longer active in Dynamo 2.1. It seems still to be possible with the API code below. Before trying to reinvent the wheel I would like to ask the community if someone already has translated the below code in C# to Python. If not then Ill try myself.
Thanks.
Wouter Hilhorst

// Get the current text XYZ position
XYZ currentTextPosition = dimToModify.TextPosition;
// Calculate a new XYZ position by transforming the current text position
XYZ newTextPosition = Transform.CreateTranslation(new XYZ(0.0, 1.0, 0.0)).OfPoint(currentTextPosition);
// Set the new text position
dimToModify.TextPosition = newTextPosition;

Solved the problem myself. :slightly_smiling_face:Attached is the script.
It works on Multi segmented dimension lines.
The repositioning of texts could be improved though
Also any other improvements are welcome!
thanks to everyone that helped!
Automatisch verplaatsen tekst maatlijn.dyn (11.4 KB)

1 Like