# Check the distance of the point from the wall

**URL:** <https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255>\
**Category:** Uncategorized\
**Created:** [December 9, 2019, 10:23pm UTC](https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255 "2019-12-09T22:23:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![c.lamMSJLD](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@c.lamMSJLD](https://forum.dynamobim.com/u/c.lamMSJLD)\
**Post date:** [December 9, 2019, 10:23pm UTC](https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255/1 "2019-12-09T22:23:53Z")

</div>

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

Have you guys tried to check if a list of points is about 2 m from a wall. Then if the distance is more than 2.3 add a new point and if it is smaller than 0.1m than move the point 0.5 m in inside? I have got a list of points in side the room.  
Any ideas on how to make it?

Thanks very much for any help!

---

<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 9, 2019, 10:58pm UTC](https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255/2 "2019-12-09T22:58:43Z")

</div>

You’d either have to know which points go with which walls or find the closest wall for each point. Then use ClosestPointTo to get a point on the wall and find the distance between those two points. The rest is a simple If statement.

---

<div class="post-metadata">

**Author:** ![c.lamMSJLD](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@c.lamMSJLD](https://forum.dynamobim.com/u/c.lamMSJLD)\
**Post date:** [December 9, 2019, 11:23pm UTC](https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255/3 "2019-12-09T23:23:12Z")

</div>

Thanks @Nick_Boyts, you have been helping me a lot! In the list, two continuous sub lists will go with one room. Is there a way where I can extract that information and then fo check the points! I am so new to python so it would be great if you can so me an example!

---

<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 9, 2019, 11:33pm UTC](https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255/4 "2019-12-09T23:33:08Z")

</div>

You probably don’t need python. Use Geometry.ClosestPointTo to find the closest points on each wall in a room. Get the distance between your original point and the new wall points. The smallest distance will represent the nearest wall and be the value that you need to compare against.

---

<div class="post-metadata">

**Author:** ![c.lamMSJLD](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@c.lamMSJLD](https://forum.dynamobim.com/u/c.lamMSJLD)\
**Post date:** [December 10, 2019, 6:10am UTC](https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255/5 "2019-12-10T06:10:26Z")

</div>

Many Thanks for that, @Nick_Boyts . But Can you tell me how to use Geometry.ClosestPointTo since there are 2 inputs and I’m not sure what to put in those. The Elements as the rooms? I am so new to this, sorry!

---

<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 10, 2019, 2:40pm UTC](https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255/6 "2019-12-10T14:40:06Z")

</div>

Hover over the node and it will give you a description. It also usually tells you what the inputs should be. The node gives you the closest point on a piece of geometry (wall geometry) to another piece of geometry (point).

---

<div class="post-metadata">

**Author:** ![c.lamMSJLD](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@c.lamMSJLD](https://forum.dynamobim.com/u/c.lamMSJLD)\
**Post date:** [December 10, 2019, 11:09pm UTC](https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255/7 "2019-12-10T23:09:17Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/0/c063e784d7ca806c97dcaeace8ff3a72606ba922.png)  
Thanks @Nick_Boyts, I get my distance, but it seems to only measures the furthest distances, even if I use Geometry.ClosestPointTo or not. Am I mising something? At the same time, how can I now check the distance and move the whole line of points if the distance is bigger than 2.3 m? I saw you mentioned Line.Direction in another post, but since the input is a line, I am not sure how to make it?

---

<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 11, 2019, 1:32pm UTC](https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255/8 "2019-12-11T13:32:00Z")

</div>

We would need to see more of your graph, with previews. I’m guessing your grouping and/or your lacing isn’t correct.

---

<div class="post-metadata">

**Author:** ![c.lamMSJLD](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@c.lamMSJLD](https://forum.dynamobim.com/u/c.lamMSJLD)\
**Post date:** [December 12, 2019, 12:08am UTC](https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255/9 "2019-12-12T00:08:58Z")

</div>

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

Here is my whole things with previews, just missing the get.room in the begining. So sorry for the mess. All of my lacing is auto. I only need to check and move the points inside the room.  
Really appreciate your information.

---

<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 12, 2019, 2:15pm UTC](https://forum.dynamobim.com/t/check-the-distance-of-the-point-from-the-wall/44255/10 "2019-12-12T14:15:16Z")

</div>

We need to see node previews, not geometry previews (although the geometry in question would also be helpful).
