# Offset from edges (Conditions Issue)

**URL:** <https://forum.dynamobim.com/t/offset-from-edges-conditions-issue/73033>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [February 5, 2022, 7:58pm UTC](https://forum.dynamobim.com/t/offset-from-edges-conditions-issue/73033 "2022-02-05T19:58:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maheeramurad](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@maheeramurad](https://forum.dynamobim.com/u/maheeramurad)\
**Post date:** [February 5, 2022, 7:58pm UTC](https://forum.dynamobim.com/t/offset-from-edges-conditions-issue/73033/1 "2022-02-05T19:58:30Z")

</div>

hello.

I am here to ask a question regarding logic and a script I am working on.

I am trying to draw an offset from all edges. I am able to achieve my goal to some extent but there is a problem when there is an opening in a slab the script works in an opposite way for the opening. As shown in the figure the script is able to detect edges and draw offset on the inside of corners or on the slab (yellow lines) but when comes to opening it selects edges and draws offset on the inside whole space (red) whereas it should be also on slab(black line).

I tried to change the conditions but I am not able to do it.

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/6/f6a1e5e2e44966b9ec991b44e6d91e734cf75337.png)

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

solution i tried to add a codeblock and conditions to seperate edges from openings. it gives this error

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

[FFINAL EDGES.dyn](https://forum.dynamobim.com/uploads/short-url/rDxEf3ggtkNce5JGxQYeG3kbqH2.dyn) (95.2 KB)

Your concern regarding this would be helpful. Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [February 5, 2022, 8:25pm UTC](https://forum.dynamobim.com/t/offset-from-edges-conditions-issue/73033/2 "2022-02-05T20:25:33Z")

</div>

Check your lines with the Line.Direction node.  
All clockwise?

---

<div class="post-metadata">

**Author:** ![maheeramurad](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@maheeramurad](https://forum.dynamobim.com/u/maheeramurad)\
**Post date:** [February 5, 2022, 8:27pm UTC](https://forum.dynamobim.com/t/offset-from-edges-conditions-issue/73033/3 "2022-02-05T20:27:27Z")

</div>

yes sir.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [February 5, 2022, 8:35pm UTC](https://forum.dynamobim.com/t/offset-from-edges-conditions-issue/73033/4 "2022-02-05T20:35:23Z")

</div>

Dont you need more offset on the void? (By looking at your sketch you do)  
Make sure you Offset nodes use a different set of values

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [February 5, 2022, 10:21pm UTC](https://forum.dynamobim.com/t/offset-from-edges-conditions-issue/73033/5 "2022-02-05T22:21:45Z")

</div>

Take the curve loops and sort them by area. This will likely requiring making a surface of each.

All but the last curve loop will want to be offset with a inverted value (-n). The last line will not want to be inverted (+n).

This is because offset is always ‘right side’ of the line, and the lines will always be clockwise so ‘into’ the interior of the loop. container; by inverting the distance you go ‘backwards’ and wind up outside of the loop.
