# Variable offset

**URL:** <https://forum.dynamobim.com/t/variable-offset/78320>\
**Category:** Packages\
**Tags:** geometry, dynamo\
**Created:** [July 4, 2022, 3:47pm UTC](https://forum.dynamobim.com/t/variable-offset/78320 "2022-07-04T15:47:16Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [July 8, 2022, 7:03am UTC](https://forum.dynamobim.com/t/variable-offset/78320/21 "2022-07-08T07:03:37Z")

</div>

Hello,  
thank you  
I found a solution with explode twice (Thank you Mr. Vikram, for your availability and pugnacity)

 ![Capture d’écran 2022-07-08 090038](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/6/f60971d66ea1adf8882fd2d5117c7339684e3a96.jpeg)  
 ![Capture d’écran 2022-07-08 090058](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/f/9f144824a6c1368b8f763d74a21afdfea0365fa7.jpeg)

cordially  
christian.stan

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [July 8, 2022, 8:57am UTC](https://forum.dynamobim.com/t/variable-offset/78320/22 "2022-07-08T08:57:35Z")

</div>

> [@christian.stan](#):
>
> I found a solution with explode twice

👌

Below is a DS function with the double explode.  
Hopefully will work with your Dynamo version too.

```auto
def unEqOffset (pgn,dst:var[]..[])
{
	crv = DSCore.List.Flatten(pgn.Explode().Explode(),-1);
	cr0 = DSCore.List.ShiftIndices(crv.Offset(dst),[1,0]);
	cr1 = cr0[0].ExtendEnd(cr0[0].Length*10);
	cr2 = cr0[1].ExtendStart(cr0[1].Length*10);
	pnt = DSCore.List.Flatten(cr1.Intersect(cr2),-1);
	return Polygon.ByPoints(pnt);
};

```

[UnequalOffset.dyn](https://forum.dynamobim.com/uploads/short-url/7t0qI6dl7EAAe6pjIJ4vgyOgTF9.dyn) (9.0 KB)

 ![UnequalOffset_2022-07-08_02-21-22](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/c/7c0223020b634156132a4f8079effe81b034aecd.png)

> [@christian.stan](#):
>
> Thank you Mr. Vikram, for your availability and pugnacity

Actually your ‘pugnacity’ needs appreciation 🙂

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [July 8, 2022, 9:06am UTC](https://forum.dynamobim.com/t/variable-offset/78320/23 "2022-07-08T09:06:08Z")

</div>

Hello,  
perfect thank you

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

Mr. Hassan will be able to put a solve.

Cordially  
christian.stan

---

<div class="post-metadata">

**Author:** ![hassan.orion](https://avatars.discourse-cdn.com/v4/letter/h/eb8c5e/32.png) [@hassan.orion](https://forum.dynamobim.com/u/hassan.orion)\
**Post date:** [July 8, 2022, 12:54pm UTC](https://forum.dynamobim.com/t/variable-offset/78320/24 "2022-07-08T12:54:12Z")

</div>

thank you guys,  
I want to point it out that i cannot seem to offset all sides inside or outside. mainly due to -+ sign on each offset. Shouldnt offset work either inside or outside, besides that, the script works.

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [July 8, 2022, 1:08pm UTC](https://forum.dynamobim.com/t/variable-offset/78320/25 "2022-07-08T13:08:59Z")

</div>

Negative value outside referent polygon

Cordially  
christian.stan

[Previous page](https://forum.dynamobim.com/t/variable-offset/78320.md?page=1)
