# Door Offset from adjacent walls

**URL:** <https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805>\
**Category:** Revit\
**Tags:** revit\
**Created:** [September 13, 2017, 10:50pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805 "2017-09-13T22:50:42Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rabindra\_Adhikari](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rabindra_adhikari/32/31788_2.png) [@Rabindra\_Adhikari](https://forum.dynamobim.com/u/Rabindra_Adhikari)\
**Post date:** [September 13, 2017, 10:50pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/1 "2017-09-13T22:50:42Z")

</div>

Please help me achieve this and learn dynamo.  
I am looking into creating a process to computationally set door offset from adjacent walls. I need your help understanding some of the logic. I don’t know how some of the dynamo nodes actually work.

Attached below is my first attempt.  
Here is the logic I am following:

1. Find all the walls (Level filtered later)
2. Find all the doors and the walls that host them.
3. Determine the walls that are connected to the wall that is hosting the door.
4. Determine the distance from those connected walls to the door.
5. Pick the shortest distance. Do the math calculating the wall widths, and distance to the center of the door.
6. Move the door toward the wall with the desired offset value.

I am stuck with the node, Geometry.DistanceTo. This is producing exact same values from two doors that are hosted in a single wall. I was hoping the distance would be calculated from the location point of each door which should yield different values.

Please advise! Thank you!

[Door Offset from Walls.dyn](https://forum.dynamobim.com/uploads/short-url/4HiXaLcqEoon5DEHSyVtMWju126.dyn) (15.0 KB)  
[DoorOffsetFromAdjacentWalls.rvt](https://forum.dynamobim.com/uploads/short-url/sI3qEcLyCMLe4Z3qn4HWdTv91GM.rvt) (2.6 MB)

---

<div class="post-metadata">

**Author:** ![Rabindra\_Adhikari](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rabindra_adhikari/32/31788_2.png) [@Rabindra\_Adhikari](https://forum.dynamobim.com/u/Rabindra_Adhikari)\
**Post date:** [September 14, 2017, 3:10pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/2 "2017-09-14T15:10:02Z")

</div>

Here is an update! I was finally able to determine the closest wall to each door. Now the challenge is to move the door closer to that wall at a given distance. I will keep working. If you have suggestions please do so.  
Attached is the updated Dynamo file. The @Levels helps structure list a whole lot better.

[Door Offset from Walls.dyn](https://forum.dynamobim.com/uploads/short-url/3Ea0F1mizvZJc926sKHzGCB70lf.dyn) (23.8 KB)

---

<div class="post-metadata">

**Author:** ![Rabindra\_Adhikari](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rabindra_adhikari/32/31788_2.png) [@Rabindra\_Adhikari](https://forum.dynamobim.com/u/Rabindra_Adhikari)\
**Post date:** [September 14, 2017, 8:10pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/3 "2017-09-14T20:10:25Z")

</div>

Made further updates. I am beginning to getting too complex. Figuring out a process to reverse vector direction based on positive or negative value is getting tricky. If someone wants to help out please do so.

The file attached is the process so far.

[Door Offset from Walls.dyn](https://forum.dynamobim.com/uploads/short-url/dX5ijCTE1gUgrQOxBsIBndRZ8xH.dyn) (44.1 KB)

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [September 14, 2017, 8:14pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/4 "2017-09-14T20:14:16Z")

</div>

It would be easier to understand with a screenshot, could you send one?

---

<div class="post-metadata">

**Author:** ![Rabindra\_Adhikari](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rabindra_adhikari/32/31788_2.png) [@Rabindra\_Adhikari](https://forum.dynamobim.com/u/Rabindra_Adhikari)\
**Post date:** [September 14, 2017, 8:45pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/5 "2017-09-14T20:45:42Z")

</div>

![OffsetDoorFromWall01](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/e/4e002ec03faaefa0dd7df907274ec11b89a72496.png)

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [September 14, 2017, 8:48pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/6 "2017-09-14T20:48:17Z")

</div>

This could be done with _If_, _\<_ and _Vector.Reverse_ nodes

---

<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:** [September 15, 2017, 11:00am UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/7 "2017-09-15T11:00:23Z")

</div>

Do you really need to reverse the vector if you have a negative distance? Moving an element 3 on the Z axis vector will move it up 3 units. Moving the same element -3 units on the Z axis will move t down 3 units.

---

<div class="post-metadata">

**Author:** ![Rabindra\_Adhikari](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rabindra_adhikari/32/31788_2.png) [@Rabindra\_Adhikari](https://forum.dynamobim.com/u/Rabindra_Adhikari)\
**Post date:** [September 18, 2017, 10:26pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/8 "2017-09-18T22:26:17Z")

</div>

Well apparently, I am still searching for an easy way to resolve this. So far here is the strategy. Attached Revit Model and Dynamo file that explains my problem. I am having difficulty with Indices of list within a list for values in a list. Attached image hopefully explains what I am having difficulty with. All my lists indices are coming as empty lists. Please advise!

![MappingIndex](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/6/666f48cd35eef00cec6d271f34f5702285f0f8b8.PNG)

[Door Offset from Walls\_v02.dyn](https://forum.dynamobim.com/uploads/short-url/2KV7cBN4qlnuuZDCk1TneUOU0qv.dyn) (31.1 KB)  
[DoorOffsetFromWalls\_Upload.rvt](https://forum.dynamobim.com/uploads/short-url/bpf8GiHI3bDUW5rmnSZc751FsEU.rvt) (2.8 MB)

---

<div class="post-metadata">

**Author:** ![Rabindra\_Adhikari](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rabindra_adhikari/32/31788_2.png) [@Rabindra\_Adhikari](https://forum.dynamobim.com/u/Rabindra_Adhikari)\
**Post date:** [September 22, 2017, 6:49pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/9 "2017-09-22T18:49:29Z")

</div>

Finally! The script is in working order. Try it yourself! Below is the dyn file and Revit (2018) sample for you to test on. See if you can use it for spurring other ideas. Thank you!

 ![Door Offset From Walls_V03](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/9/d9d05ece6b5ed550ffda99b9e408aa8da57fa042.png)

[Door Offset from Walls\_v03.dyn](https://forum.dynamobim.com/uploads/short-url/4hNC9ehtcBkwKZvfOHZzW9b2s24.dyn) (51.4 KB)  
[DoorOffsetFromWalls\_Upload.rvt](https://forum.dynamobim.com/uploads/short-url/bpf8GiHI3bDUW5rmnSZc751FsEU.rvt) (2.8 MB)

---

<div class="post-metadata">

**Author:** ![Rabindra\_Adhikari](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rabindra_adhikari/32/31788_2.png) [@Rabindra\_Adhikari](https://forum.dynamobim.com/u/Rabindra_Adhikari)\
**Post date:** [September 22, 2017, 6:51pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/10 "2017-09-22T18:51:32Z")

</div>

Thank you Yna\_Db!

---

<div class="post-metadata">

**Author:** ![AdamHamilton](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@AdamHamilton](https://forum.dynamobim.com/u/AdamHamilton)\
**Post date:** [December 20, 2017, 8:28pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/11 "2017-12-20T20:28:17Z")

</div>

I was looking at your script…nice work…I have to make some suggestions after testing.

1. add a filter for nested elements
2. filter out non-wall hosted doors
3. Curtain Wall Doors do not have a location
4. the cross lacing for wall intersection is a brutal time suck. I will attempt to filter walls before the intersection check to speed it up.

---

<div class="post-metadata">

**Author:** ![AdamHamilton](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@AdamHamilton](https://forum.dynamobim.com/u/AdamHamilton)\
**Post date:** [December 22, 2017, 8:13pm UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/12 "2017-12-22T20:13:27Z")

</div>

my for now final

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

---

<div class="post-metadata">

**Author:** ![Rabindra\_Adhikari](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rabindra_adhikari/32/31788_2.png) [@Rabindra\_Adhikari](https://forum.dynamobim.com/u/Rabindra_Adhikari)\
**Post date:** [January 22, 2018, 2:27am UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/13 "2018-01-22T02:27:22Z")

</div>

Adam! I was wondering if you could upload your version of Dynamo file so we all can learn more. Thanks!

---

<div class="post-metadata">

**Author:** ![nazeem.jummun](https://avatars.discourse-cdn.com/v4/letter/n/ecc23a/32.png) [@nazeem.jummun](https://forum.dynamobim.com/u/nazeem.jummun)\
**Post date:** [July 21, 2025, 3:48am UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/14 "2025-07-21T03:48:34Z")

</div>

Hi Adam. I am very new to Dynamo. I want to built that script but the image is quite blurry to read. It would be much appreciated if you may please share the script. Thank you in advance

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 21, 2025, 5:27am UTC](https://forum.dynamobim.com/t/door-offset-from-adjacent-walls/14805/15 "2025-07-21T05:27:18Z")

</div>

Hello @nazeem.jummun and welcome to the forum 😉 😉 that post here is 7 years old, and have a solution there work at that time, but in the last 7 years many things have changed, so try start up and then create a new topic is you go stock, with all you material so far, and the community would love to help if we can 😉 😉 welcome
