# Find nearest room for an element

**URL:** <https://forum.dynamobim.com/t/find-nearest-room-for-an-element/5333>\
**Category:** Revit\
**Tags:** steamnodes, archi-lab\
**Created:** [July 31, 2016, 10:58pm UTC](https://forum.dynamobim.com/t/find-nearest-room-for-an-element/5333 "2016-07-31T22:58:38Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [August 1, 2016, 10:38pm UTC](https://forum.dynamobim.com/t/find-nearest-room-for-an-element/5333/10 "2016-08-01T22:38:45Z")

</div>

@Rune_Haugland You are correct in your assumption, Tool.SurroundingElements uses the “[BoundingBoxIntersectsFilter](http://revitapisearch.com/html/1fbe1cff-ed94-4815-564b-05fd9e8f61fe.htm)” witch filters out objects that are contained or intersects with the BB. The problem with bounding boxes is that they must be rotated along the global x and y axis. The image below shows two identical beams and columns, but the filter works differently on them because of the rotation:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/7/78575bbb2d5185e9eeb862d1a9146a15a572951c.png)

Have you tried the Geometry.DistanceTo node? Here is an example:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/d60cf7ae95df6f33fe286dc0efb37558c9dc4b4a.png)

---

_[View the full topic](https://forum.dynamobim.com/t/find-nearest-room-for-an-element/5333)._
