Rotate Family Instances by Xaxis together with Zaxis

Hello everyone,

I have quite a big problem with my Dynamo script. I have a pipe network created which places Pipes along imported Lines by that line Layer. The script also rotates the pipes along the zaxis of the corresponding Line.

The problem with my script is the Xaxis rotation, i just can’t get my pipes to rotate along the Xaxis.
I have tried creating Adaptive families, but this didnt work.

I hope someone knows how to fix this problem!

Screenshots & Files:

Line and Block Extraction 13-11-2019.xls (31.5 KB) Rioolbuizen Script 13-11-2019.dyn (390.4 KB)
Revit File: (Bigger Than 4096kb)

Did you try Structural framing CHS “Circular Hollow Section” ?

You can use a adaptive Family with two placement points.
The profil needs to be centered like in this family:

adaptive pipe.rfa (452 KB)

All you need to get every starting and end point of every curve and use these points for the placement of your adaptive pipes.