# Arc placement and rotation issue

**URL:** <https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125>\
**Category:** Geometry\
**Tags:** geometry\
**Created:** [December 6, 2021, 5:47pm UTC](https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125 "2021-12-06T17:47:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![denisyukj](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/denisyukj/32/166182_2.png) [@denisyukj](https://forum.dynamobim.com/u/denisyukj)\
**Post date:** [December 6, 2021, 5:47pm UTC](https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125/1 "2021-12-06T17:47:37Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/0/80a709ac4f699b1808d5b396998c48f648a72d71.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/9/a911bb86cbbd2627b897be997105645bc45923be.png)  
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](https://forum.dynamobim.com/uploads/short-url/m9uTq5taChhyNhmIssuqChLEbvy.xlsx) (12.0 KB)  
[Placement and rotarion among the curveкривой.dyn](https://forum.dynamobim.com/uploads/short-url/czCJhW7Jg5ZQkn6Vw2ngMYU2pUI.dyn) (45.3 KB)  
[ProjectSample.rvt](https://forum.dynamobim.com/uploads/short-url/fEWMzvhBwNeISCEMPcU4g5Uoeth.rvt) (1.2 MB)

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 6, 2021, 5:53pm UTC](https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125/2 "2021-12-06T17:53:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![denisyukj](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/denisyukj/32/166182_2.png) [@denisyukj](https://forum.dynamobim.com/u/denisyukj)\
**Post date:** [December 7, 2021, 7:03am UTC](https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125/3 "2021-12-07T07:03:34Z")

</div>

@Nick_Boyts  
Hi, thank you for your support. Like this?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/2/12aba52d6ba44a65a33a5cafa12dc3d6b7ed8d8d.png)  
[Placement and rotarion among the curve\_upd.dyn](https://forum.dynamobim.com/uploads/short-url/cjNcY95GiYSaOdEXTuEc1G69vRr.dyn) (71.7 KB)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 7, 2021, 2:58pm UTC](https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125/4 "2021-12-07T14:58:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![denisyukj](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/denisyukj/32/166182_2.png) [@denisyukj](https://forum.dynamobim.com/u/denisyukj)\
**Post date:** [December 8, 2021, 11:47am UTC](https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125/5 "2021-12-08T11:47:24Z")

</div>

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?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/a/ba7ba3891cf40cf5862332978e7126eaa802ad15.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 8, 2021, 3:13pm UTC](https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125/6 "2021-12-08T15:13:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 8, 2021, 3:57pm UTC](https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125/7 "2021-12-08T15:57:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![denisyukj](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/denisyukj/32/166182_2.png) [@denisyukj](https://forum.dynamobim.com/u/denisyukj)\
**Post date:** [December 8, 2021, 5:55pm UTC](https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125/8 "2021-12-08T17:55:13Z")

</div>

This is graph and rusult in Revit.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/b/5bd24b6fd3ec714fd3d5c1539d6aefd9b775a698.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/6/56ff6b61f90d1016cd6b9ce9ae83a7971d7b0017.png)  
If I am changing true result to +1 from -1, mess is coming back 🙂

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 8, 2021, 7:33pm UTC](https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125/9 "2021-12-08T19:33:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![denisyukj](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/denisyukj/32/166182_2.png) [@denisyukj](https://forum.dynamobim.com/u/denisyukj)\
**Post date:** [December 11, 2021, 2:21pm UTC](https://forum.dynamobim.com/t/arc-placement-and-rotation-issue/71125/10 "2021-12-11T14:21:47Z")

</div>

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.
