Get Rotation of Line

Is there any way to get the rotation of a line from a certain axis going around clockwise? Im having an issue where i need to get the lines angle to set the angle of a family i have placed. But it changes depending on which direction i model the conduits. is there a 0-360 node or something. Right now when i try to add my hangers if i draw the conduit one way it works. but if i draw it the other way it doesnt. please see the line sketch for what im wanting for angles and the issue of what happens to the hangers when i draw the same angle but from different directions.

WANTED:


PROBLEM:

GRAPH:

I think i could figure it out if i could find a consistent way to get the angle of the line. I just dont know how to do that.

Try this way (Zhukoven package):

Thank you @Vladimir it worked perfectly!! can you walk me through what its doing though so i understand for next time?

I think, main point is IF degree > 180, we calculate degree-360.
Angle+90 is used as a trigger for perpendicular placement of families.

1 Like

@Vladimir Maybe you can help me with this? im trying to find the best way to get the perpendicular distance between the pipes center to center. right now this is what i have.
WHAT I WANT:


WHAT I HAVE:

It needs to work with all angles that the pipes get drawn at.

How do you know, if this six tubes of angle 0 differs from other tubes of angle 0?

i dont think i understand the question. I attached the DYN.Place Rack Hangers.dyn (193.9 KB) TE_HANGER.rfa (3.8 MB)

And the family im trying to place

1 Like

How will you separate two clusters of pipes(let’s say at one level)?

right now you have to go straight run by straight run and you manually select the pipes. After that i get the element curve and take the max x point and the min x point, then max y and min y point to subtract and get the difference.

@Vladimir i need to be able to get the perpendicular distance between the two outside pipes

Build Plane from any line and it’s vector.
Find intersections for all lines and plane via “[&] Vector.ProjectToPlane” from Ampersand package.
Build Line by BestFitThroughPoints. Get it’s midpoint.
If we have straight lines, it’s better to operate with infinite vectors of them, so we don’t care about problems, when some points gets lost.

3 Likes