Array and Rotation along a curvev


I am trying to create a graph that will array a revit family along a curve and rotate it so that the element is always facing towards the centre point of the curve.

So far I have created tangents along the line at the insertion points and rotated the elements by the degree between the tangent and x axis.

I think its do do with the y value of the tangent being +ve or -ve but I cant work it out.

Thanks in advanceArray Script-ORIGINAL.dyn|attachment (32.9 KB)

Hope this one helps

I forgot to say the problem, it places it along the curve but it does not always rotate the familys properly.