How to rotate families along a curve?

Hello guys, I’m new here and would like help if possible

I’m trying to create a routine to put posts on curved streets. Initially I managed to extract the curvature of the track and launch the posts at a predetermined distance. Now I would like the posts to be perpendicular to the street.
I saw on some forums that a solution could be to use FamilyInstance.SetRotation, but I believe I’m not sure how to apply it correctly.
If someone could help me with this I would be very grateful, I don’t know if it’s something small or if I’m just doing it wrong? Any guidance would be great!

Use ParameterAtPoint to find where your placement Points are along the line.
Use NormalAtPoint to find the direction of the curve at that point.
Use AngleBetweenAxis (unsure of the Node name here) to find the angle between the Y-direction (default of the families being placed) and the Normal direction at that point.
Use SetRotation to rotate the families that specific amount.

You also might want to start looking at topics involving Hangers on Pipes/Ducts, they are dealing with the exact same problem.

Thank you @Bjorn_Keulemans1
I will test your suggestions and come back with the news.

This just got posted, I would suggest analyzing this example:

1 Like

Bejamim followed his instructions and was almost successful. I managed to rotate the posts, but some points didn’t go in the right direction, I couldn’t find the problem. I noticed that the points that are not rotating correctly are with the z axis in a different direction from the others. If anyone can contribute any ideas I would be very grateful.

Try something like this…

Family Rotates along the path.dyn (62.1 KB)

@_Vijay unfortunately I was not successful with your idea. Anyway thanks for trying

What is the error or what is the problem with it…can you elaborate…so that we can try further.

Some points are not getting tangent to the curve, such as the one highlighted in the image. I was not able to discover the problem but I noticed that the points that are not tangent to the curve have their z vector 180 degrees in the opposite direction to the others.

See if the below workflow solves the issue …

alignToCurve.dyn (40.0 KB)