Can not make the Tag center in horizontal / vertical

hi, I am beginner, I want the Text near the pipe outlet and center in horizontal / vertical but I don’t how to do? Maybe can add IF or something else? Thanks.

Hi Yuk, welcome to the forum
We all were starting out at sometime!

The way I have tackled this is using a bit of linear algebra to get the tags to move in the direction you want using the pipe geometry and then a bit of logic

Firstly I get the location curve of the pipe/conduit and use the start and ends to get a vector. I have then normalised to a unit vector.

Unfortunately these may have negative values - so to get a consistent placement I test for negative values and select the opposite vector using a little design script

v.X==-1||v.Y==-1?r:v; If vector.X or vector.Y is -1 use the reverse vector, otherwise carry on with the existing vector (This will only work for pipes orthogonal to the coordinate system)
Edit you could use v.X<v.Y?r:v; which will work for all angles

You then take the cross product of a Z-axis vector which gives the offset you need perpendicular to the pipe


image

2 Likes

With a bit of testing v.X>=0?r:v; works best