Align Block to Polyline

I’m basically trying to do what the measure command does when you place blocks around a polyline and it prompts you to align objects to the polyline direction. I can create points and blocks but for ‘rotationDegrees’ I would either need each point to evaluate the direction that the polyline is traveling in or at the very least evaluate the previous point and create a rotation angle from that. But I have no idea.

Hi
Looking at this

And

Thanks Hosneyalaa

1 Like

Would it be easier to turn the polyline into an alignment? I’m having a hard time sorting out what I need to do for this compared to the 2 posts you linked to me.
MJS-Divide.dyn (33.9 KB)

Hi @Matthew.Schwartz

Turning the polyline into an alignment is another way to go about it but the concept behind both ways will be the same. I think the best way to figure out the rotation is using a coordinate system along the polyline (can also use a coordinate along an alignment as well). Coordinate systems align along the direction of the polyline.

Here are a couple of nodes that could help you solve what you’re looking to do.
image
You first get the coordinate system and then place the block by that coordinate system. Parameters range from 0 to 1 along the length of the curve (polyline/polycurve in your case) so you’ll need to determine where along polyline you want your blocks. So something like this


Hope that helps

2 Likes

Got it to work! Wanted to share my results with anyone that might be passing through. Thank you @hosneyalaa and @omar.g for the assistance!

3 Likes