Problems with unwanted rotation of rebar. Package from DiRoots

Hi everyone!

I hope you’re doing fine. First of all: I just got started using Dynamo (and this forum) so i’m a real noob - and i’ve tried to solve my problem on my own - but this is as far as I come.

So. I am trying to create a script that allows the user to place ONE rebar and then Dynamo places the rest along the given path. In this case it’s a bridge with a double curve and I want to create an array (don’t know if it’s called array in Dynamo) of rebar in the edge beam. It works fine when i’m doing it in a mass thats only curved one way, but as soon as i add a curve in the Z-axis it’s not working anymore.
I get my rebar to place at the points I want, but they are starting to rotate out of control, please see attached pictures.

I’m using Revit 2021 and the latest Dynamo (2.6.1.8850) and the nodes i’ve used so far are from BIM4struc and DiRoots packages. My first guess is that some of the nodes are to old, but this is still the furthest i’ve come.

It’s not necessary for me to do it like the script i’ve done so far - if you got a better ideaI would happily do it. If you have any suggestions or can point me in the right direction, I would be very grateful.

Thanks!

EDIT: OK, LOOKS LIKE I NEW USER ONLY CAN ATTACH ONE PICTURE… HOPE YOU STILL UNDERSTAND WHAT I’M TRYING TO DO. I DON’T THE “FAN-EFFECT” THAT I CURRENTLY GOT ON MY REBARS.