# Best way to match MEP Space to his corresponding Room?

**URL:** <https://forum.dynamobim.com/t/best-way-to-match-mep-space-to-his-corresponding-room/86487>\
**Category:** Revit\
**Created:** [February 22, 2023, 3:40pm UTC](https://forum.dynamobim.com/t/best-way-to-match-mep-space-to-his-corresponding-room/86487 "2023-02-22T15:40:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [February 22, 2023, 3:40pm UTC](https://forum.dynamobim.com/t/best-way-to-match-mep-space-to-his-corresponding-room/86487/1 "2023-02-22T15:40:25Z")

</div>

Hello,

how can i match Space data to roomdata…

i have one stable Room and Space number but how can filter them correctly …  
so that each room got his corresponging Space information?

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/e/8eb3693753e7c87b43be2ee40bc1a6d6a3ebdd33.png)

i man like this

```auto
spacenumber == roomnumber ? "GetSpaceSetRoomParameter" : " do nothing"

```

KR

Andreas

---

<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:** [February 22, 2023, 3:54pm UTC](https://forum.dynamobim.com/t/best-way-to-match-mep-space-to-his-corresponding-room/86487/2 "2023-02-22T15:54:25Z")

</div>

This is just typical filtering. It’s covered all over the forums. You can compare directly and filter for every item or you can create a dictionary with space/room information and use that to return rooms. Spaces also have a Room property that would get you the room directly.

> **[Room Property](https://www.revitapidocs.com/2022/e6b482cd-2466-0bc0-77ca-c40d2adaa3c7.htm)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [February 22, 2023, 4:06pm UTC](https://forum.dynamobim.com/t/best-way-to-match-mep-space-to-his-corresponding-room/86487/3 "2023-02-22T16:06:16Z")

</div>

@Nick_Boyts ,

Issue is the Number from rooms is not in use…  
i have a parameter SpaceNumber (for the IfcExport) that is equial to Number(Space)

![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/9/a9d894253c60ab989080daea98c5c460ed407b4d.png)

is there a other way to access the parameter ?

altertivly how can i access a “combined” parameter ?

 ![2023-02-22_16h44_55](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/2/e21dd0ab7b964815eba6d0f16e4d8e8028dacefa.png)

KR

Andreas

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [February 22, 2023, 4:38pm UTC](https://forum.dynamobim.com/t/best-way-to-match-mep-space-to-his-corresponding-room/86487/4 "2023-02-22T16:38:52Z")

</div>

@Nick_Boyts ,

So i got this but i am still struggeling to get the right rooms/Spaces

 ![GetSpaceNumbervsSetRoomNumber_2023-02-22_05-37-31](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/d/ad41cf1356402222fd2d4d908f75ee402ead85db.png)  
[GetSpaceNumbervsSetRoomNumber.dyn](https://forum.dynamobim.com/uploads/short-url/3WNUzikcU4L8TSzeuLcCerEWNK4.dyn) (34.2 KB)  
KR  
Andreas

---

<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:** [February 22, 2023, 4:52pm UTC](https://forum.dynamobim.com/t/best-way-to-match-mep-space-to-his-corresponding-room/86487/5 "2023-02-22T16:52:52Z")

</div>

> [@Draxl\_Andreas](#):
>
> Issue is the Number from rooms is not in use…  
> i have a parameter SpaceNumber (for the IfcExport) that is equial to Number(Space)

What do you mean the number for rooms is not in use? Rooms have a number by default. Spaces will read the name and number of the room they are in.

Are you dealing with native Revit objects or are they IFC?

> [@Draxl\_Andreas](#):
>
> altertivly how can i access a “combined” parameter ?

Combined parameters are only in schedules. They don’t actually get assigned to the element so they don’t exist. However, they’re just a combination of other parameters so you can build it on the fly yourself.

What do the errors from your graph say? It looks like you’re using `GetItemAtIndex` but you aren’t providing indices. I would recommend looking at some topics dealing with matching Excel data with Revit data. It’s the same general process: you have one set of data that needs to be compared with another set of data.

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [February 22, 2023, 4:56pm UTC](https://forum.dynamobim.com/t/best-way-to-match-mep-space-to-his-corresponding-room/86487/6 "2023-02-22T16:56:47Z")

</div>

@Nick_Boyts

nativ Rooms, and linked spaces… it is a closed BIM Project, BUT the **client wishes IFC** so i have to map the Space information … arount 30 Parameters from LinkedSpaces to my rooms!

the space creation is based on this SpaceNumber.

KR

Andreas

---

<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:** [February 22, 2023, 5:16pm UTC](https://forum.dynamobim.com/t/best-way-to-match-mep-space-to-his-corresponding-room/86487/7 "2023-02-22T17:16:32Z")

</div>

If the linked space model has the room model linked in then the spaces should have access to the room information. You could use that to determine which room to transfer space data to.

If you don’t have access to that information, then you need to do a manual map, either by filtering or by dictionary, to get the correct space-room pairing.

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [February 22, 2023, 5:19pm UTC](https://forum.dynamobim.com/t/best-way-to-match-mep-space-to-his-corresponding-room/86487/8 "2023-02-22T17:19:43Z")

</div>

@Nick_Boyts ,

i thought also in a dictionary like

```auto
{M031U2021 : M031U2021},{"RoomNumber" : "MEP-SpaceNumber"} 
#can i filter them like pairs?

```

---

<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:** [February 22, 2023, 5:24pm UTC](https://forum.dynamobim.com/t/best-way-to-match-mep-space-to-his-corresponding-room/86487/9 "2023-02-22T17:24:02Z")

</div>

You would create a dictionary of `{SpaceNumber : [SpaceData]}` from your spaces. Then you would use that to lookup the matching `SpaceNumber` with the room’s `Number`, returning the associated `[SpaceData]` for that room.
