Direction of FeatureLine between stations --> Rotation on the XY plane

Hello,

I am trying to import blocks along my corridor feature line in Civil3D. I was able to rotate the block around the YZ plane which was one of my main goals. I did this by using the geometry of a blockreference that I already created.
image

My problem is that I made a mistake because I thought that my corrdor with an intervall of 10 metres means that my corridorfeatureLine will have a constant direction between these 10 metres.

Well, this is wrong. As well as the rotation (on the XY plane) of 52 degrees (see picture or .dyn). So I am trying to get the direction of the baseline (made of the alignement) or the alignement in order to get the rotation angle (on the XY plane) for my block reference.
When I am using CorridorFeatuelinePolyCurve I am just getting the 32 stations (10 m intervall) which is not helping me. So what I want is to get the direction of the baseline between specific points of my interest. After that I could use Vector.AngleWithVector for the calculation of my rotation.
OR any other ideas that work.

On this last picture you can see from above that the blocks are not 100 % perpendicular on the gradient (baseline is made out of gradient (Z) and alignment (X,Y)).

Dynamo 14_10 Forum.dyn (120.1 KB)

Are there any suggestions? I hope I dont confuse you with my English and with my script (its my first week).

Cheers,

Thomas

I forgt: This is my subassembly. The rotation takes place at stations along the feature Line PO (Origin). You can see that in the script.
image

Hi @kundthomas,

Try getting coordinate systems along the corridor feature line and then use the BlockReference.ByCoordinateSystem node instead of BlockReference.Create. The Y-axis of each coordinate system will always be tangential to the feature line, so it will take care of the rotation automatically.

1 Like

Thank you @mzjensen. It worked well and that was a nice and easy way :slight_smile: