# How to determine the space which an element belongs to?

**URL:** <https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917>\
**Category:** Packages\
**Created:** [August 3, 2015, 3:36am UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917 "2015-08-03T03:36:22Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikolay\_Gerasimov](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@Nikolay\_Gerasimov](https://forum.dynamobim.com/u/Nikolay_Gerasimov)\
**Post date:** [August 3, 2015, 3:36am UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/1 "2015-08-03T03:36:22Z")

</div>

Spacial position of an element isn’t something obvious and out-of-the-box in Dynamo, although it is a very important property.

There is a node in LunchBox for all elements in rooms, how to transform it into “elements in MEP spaces”?

Or even better, how to query the space which an element belongs to?

---

<div class="post-metadata">

**Author:** ![Sylvester\_Knudsen](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Sylvester\_Knudsen](https://forum.dynamobim.com/u/Sylvester_Knudsen)\
**Post date:** [August 3, 2015, 4:39am UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/2 "2015-08-03T04:39:48Z")

</div>

Hi Nikolay,

Not sure if there are a more simple way of doing this, but here is one soloution that would work.

![ElementInSpace](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/4/43d98f9481fb97e09a1c632b5949c78a2b3d707a.png)

&nbsp;

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Nikolay\_Gerasimov](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@Nikolay\_Gerasimov](https://forum.dynamobim.com/u/Nikolay_Gerasimov)\
**Post date:** [August 3, 2015, 1:18pm UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/3 "2015-08-03T13:18:19Z")

</div>

Thank you, Sylvester, I thought about this approach: trying to guess by creating all possible combinations, but it is very time consuming on real projects.

Somehow Revit itself knows spacial position of each element (schedules can be created very fast), so I think there is a native way…

---

<div class="post-metadata">

**Author:** ![Thorbjorn\_Hoverberg1](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@Thorbjorn\_Hoverberg1](https://forum.dynamobim.com/u/Thorbjorn_Hoverberg1)\
**Post date:** [August 5, 2015, 6:40am UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/4 "2015-08-05T06:40:46Z")

</div>

Sure - there’s code in the API for finding out in which Space or Room an element resides, it’s a property on a FamilyInstance if you read the SDK help document. The only issue if that you also need to provide which Phase you’re interested in.

You can do something like this:

![2015-08-05 14-07-03](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/6/612f46c8f34cf291efb03765edc01b338bbf3cfe.png)

---

<div class="post-metadata">

**Author:** ![Thorbjorn\_Hoverberg1](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@Thorbjorn\_Hoverberg1](https://forum.dynamobim.com/u/Thorbjorn_Hoverberg1)\
**Post date:** [August 5, 2015, 7:38am UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/5 "2015-08-05T07:38:57Z")

</div>

And if you would like to do the same on many elements - some will not be FamilyInstances, some will not be in a Space - so YMMV:

![2015-08-05 15-05-40](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/e/e83b1f0ffc181f1247fed293550ceaebd369a790.png)

---

<div class="post-metadata">

**Author:** ![Michal\_Dengusiak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michal_dengusiak/32/92831_2.png) [@Michal\_Dengusiak](https://forum.dynamobim.com/u/Michal_Dengusiak)\
**Post date:** [February 10, 2016, 7:53am UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/6 "2016-02-10T07:53:14Z")

</div>

Hi I tried this code band works 🙂

---

<div class="post-metadata">

**Author:** ![Michal\_Dengusiak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michal_dengusiak/32/92831_2.png) [@Michal\_Dengusiak](https://forum.dynamobim.com/u/Michal_Dengusiak)\
**Post date:** [February 10, 2016, 5:18pm UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/7 "2016-02-10T17:18:31Z")

</div>

How should we modify code that in case there is no space there will be null and no skip like now…I need script that will keep right lengtht of my list so can later on bring parameters…now when element is place and there is no space my list is shorted and this causing me issues, thanks a lot Michal

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [February 10, 2016, 9:41pm UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/8 "2016-02-10T21:41:14Z")

</div>

Rhythm has an element.space node that should do this.

---

<div class="post-metadata">

**Author:** ![Michal\_Dengusiak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michal_dengusiak/32/92831_2.png) [@Michal\_Dengusiak](https://forum.dynamobim.com/u/Michal_Dengusiak)\
**Post date:** [February 11, 2016, 4:08am UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/9 "2016-02-11T04:08:25Z")

</div>

I just checked Rhythm 2015.10.7 and could not find any space node there I can see only Element.Room ?

---

<div class="post-metadata">

**Author:** ![Michal\_Dengusiak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michal_dengusiak/32/92831_2.png) [@Michal\_Dengusiak](https://forum.dynamobim.com/u/Michal_Dengusiak)\
**Post date:** [February 11, 2016, 4:25am UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/10 "2016-02-11T04:25:05Z")

</div>

OK i found this in Rhytm 2016.2.8 thanks a lot

---

<div class="post-metadata">

**Author:** ![Michal\_Dengusiak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michal_dengusiak/32/92831_2.png) [@Michal\_Dengusiak](https://forum.dynamobim.com/u/Michal_Dengusiak)\
**Post date:** [February 19, 2016, 8:26am UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/11 "2016-02-19T08:26:05Z")

</div>

I have almost everything working one issue remaining when I extract instant parameters value from link model everything works OK but when I try to extract type paramter it does not work?

How to get type parameters?

 ![2016-02-19 14_54_45-DynamoInstant](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/7/73856eb9fe4f47ce461260d6ec04c56a80baf6cb.png)

&nbsp;

---

<div class="post-metadata">

**Author:** ![Tomasz\_Puchala](https://avatars.discourse-cdn.com/v4/letter/t/5f9b8f/32.png) [@Tomasz\_Puchala](https://forum.dynamobim.com/u/Tomasz_Puchala)\
**Post date:** [February 19, 2016, 8:39am UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/12 "2016-02-19T08:39:30Z")

</div>

Hi,

try: linked elements -\> getParameter(Family) -\>GetParameter(Voltage)

---

<div class="post-metadata">

**Author:** ![Michal\_Dengusiak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michal_dengusiak/32/92831_2.png) [@Michal\_Dengusiak](https://forum.dynamobim.com/u/Michal_Dengusiak)\
**Post date:** [February 22, 2016, 12:18pm UTC](https://forum.dynamobim.com/t/how-to-determine-the-space-which-an-element-belongs-to/1917/13 "2016-02-22T12:18:53Z")

</div>

Hi Tomasz,

I am not sure what you mean by getParameter(Family) here? to type family name in component Element.GetParameterValueByName?.. I have many families under LightingFixture category…
