Hello everyone,

I made a script which place an elements among a curve and allign it with normal line in this point of curve. But when angle > 90 and < 270, mess is begining. I already understand that Revit can’t set a angular dimension more then 180 deg, but I can’t imagin how to fix it inside my script.

For instance, in this point angle is 352’53’’ (or -7’47’’) but Dynamo made a mod of it.

Probably I can multiply list of angles by list of positive or negative 1, but how to catch this moment?

My sample file, script and parameter spredsheet in attached.

ParameterSample.xlsx (12.0 KB)

Placement and rotarion among the curveкривой.dyn (45.3 KB)

ProjectSample.rvt (1.2 MB)

Thank you in advance.

You’re correct in needing to multiply by positive or negative. You’ll probably want to check the X or Y portion of the normal vector for a positive or negative direction. Depending on the combination of X and Y directions you should know whether to flip your angle or not.

1 Like

That’s the right idea, but you’ll have to determine which quadrant the vector belongs to (relative to the curve) in order to know whether you need to flip the angle or not. You’re essentially trying to determine the angle in 360 degrees instead of 90.

Hm. We’ve gor a mess in 2nd and 3rd quadrant, so increment of Y is always more > 0. Do families always place opposite clockwise or there are cases when direction is changing? Should I create flip rule based not on Vector.ByTwoPoints output, but on start (or end) point of tangent curve?

Direction of the curve should dictate the normal direction, but I think you’re still making a few assumptions. If everything is coming from Dynamo you may be able to trust it enough. It’s certainly worth trying out.

I tried this myself and had no issues. My angles are coming back 0-180 instead of 90. Can you show the rest of your graph (with preview bubbles) so we can see exactly what you’re doing?

This is graph and rusult in Revit.

If I am changing true result to +1 from -1, mess is coming back

I was having a hard time following your specific problem since you originally mentioned that the issue is with angles between 90 and 270 degrees, but your example is 352. I thought the issue was with the angle not returning more than 90 degrees.

The problem is that you are calculating the angle of rotation from the X axis, but most families are built along the Y axis (pointing “up”). The other confusing part is that the family instance rotation parameter rotates clockwise instead of counterclockwise. Assuming your family is oriented “up”, your angle of rotation should really be `90 - NormalAngle`

. That should account for the 90 degree difference in axes and flip the direction of the angle.

Yes, I defenetly make a confuse with axis. What about orientation it’s new for me. I never thought about that in advance.

So thank you for support, I really appriciate your help.