# Offsetting curve in a random direction

**URL:** <https://forum.dynamobim.com/t/offsetting-curve-in-a-random-direction/54981>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [September 9, 2020, 7:59pm UTC](https://forum.dynamobim.com/t/offsetting-curve-in-a-random-direction/54981 "2020-09-09T19:59:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrkpkimEMSRM](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrkpkimEMSRM](https://forum.dynamobim.com/u/mrkpkimEMSRM)\
**Post date:** [September 9, 2020, 7:59pm UTC](https://forum.dynamobim.com/t/offsetting-curve-in-a-random-direction/54981/1 "2020-09-09T19:59:18Z")

</div>

hello, I have set of curves that I would like to offset towards the ‘outside’. However I’m not sure how to control it.

thank you! script is attached below

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/c/8cd5172d5982fc4f4c91fb9fb75c6fc7821fe176.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/4/643578392cdefe4a9b606b701bd1a2004e11229b.png)  
[curve out.dyn](https://forum.dynamobim.com/uploads/short-url/w6ZsaK0K8qkz8WzZgRBSR52tk6Z.dyn) (72.4 KB)

---

<div class="post-metadata">

**Author:** ![blsalvio](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@blsalvio](https://forum.dynamobim.com/u/blsalvio)\
**Post date:** [September 10, 2020, 12:01am UTC](https://forum.dynamobim.com/t/offsetting-curve-in-a-random-direction/54981/2 "2020-09-10T00:01:28Z")

</div>

Hi @mrkpkimEMSRM,

Your explanation I think is a little bit vague. What do you mean “outside”? Away from a specific point? If its away from a specific point, can you define it? A little bit more explanation is helpful.  
Thanks.

---

<div class="post-metadata">

**Author:** ![mrkpkimEMSRM](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrkpkimEMSRM](https://forum.dynamobim.com/u/mrkpkimEMSRM)\
**Post date:** [September 10, 2020, 3:07pm UTC](https://forum.dynamobim.com/t/offsetting-curve-in-a-random-direction/54981/3 "2020-09-10T15:07:40Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/8/0896ea56014060eb6c708133b671731453361bfe.jpeg)

I’m trying to offset mid points of each rectangles towards inside (where the blue point is).  
However, the offset happening on the long rectangle is keep going outward or the other side.

---

<div class="post-metadata">

**Author:** ![mrkpkimEMSRM](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrkpkimEMSRM](https://forum.dynamobim.com/u/mrkpkimEMSRM)\
**Post date:** [September 10, 2020, 3:08pm UTC](https://forum.dynamobim.com/t/offsetting-curve-in-a-random-direction/54981/4 "2020-09-10T15:08:25Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/9/e97cd96e38ff8bb4ea262b5b82e79b4ac8c0daea.jpeg)

this is the script that i used

---

<div class="post-metadata">

**Author:** ![AmolShah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/amolshah/32/103244_2.png) [@AmolShah](https://forum.dynamobim.com/u/AmolShah)\
**Post date:** [September 10, 2020, 3:25pm UTC](https://forum.dynamobim.com/t/offsetting-curve-in-a-random-direction/54981/5 "2020-09-10T15:25:16Z")

</div>

You can either reverse the direction of the vector **OR** multiply the distance with -1.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/e/9ee60c13a83b4be7889cc79e9ecb91d8ac468d87.png)

---

<div class="post-metadata">

**Author:** ![mrkpkimEMSRM](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrkpkimEMSRM](https://forum.dynamobim.com/u/mrkpkimEMSRM)\
**Post date:** [September 10, 2020, 3:28pm UTC](https://forum.dynamobim.com/t/offsetting-curve-in-a-random-direction/54981/6 "2020-09-10T15:28:53Z")

</div>

thank you - but wouldnt that apply to everything? including the points that have been offsetted in a correct direction? Is there a way where ddynamo can find out the ones that are incorrect and change the vector?

---

<div class="post-metadata">

**Author:** ![AmolShah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/amolshah/32/103244_2.png) [@AmolShah](https://forum.dynamobim.com/u/AmolShah)\
**Post date:** [September 10, 2020, 3:30pm UTC](https://forum.dynamobim.com/t/offsetting-curve-in-a-random-direction/54981/7 "2020-09-10T15:30:19Z")

</div>

Yes, it would apply to everything. So the direction has to be reversed based on an IF condition.

---

<div class="post-metadata">

**Author:** ![AmolShah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/amolshah/32/103244_2.png) [@AmolShah](https://forum.dynamobim.com/u/AmolShah)\
**Post date:** [September 10, 2020, 3:33pm UTC](https://forum.dynamobim.com/t/offsetting-curve-in-a-random-direction/54981/8 "2020-09-10T15:33:06Z")

</div>

> [@mrkpkimEMSRM](#):
>
> Is there a way where ddynamo can find out the ones that are incorrect and change the vector?

Dynamo is not there yet. So it won’t be able to identify the incorrect ones by itself.

You would probably have to find a pattern or logic to find the incorrect ones and then translate that logic into nodes for Dynamo!
