# Room ToElement node

**URL:** <https://forum.dynamobim.com/t/room-toelement-node/97185>\
**Category:** Packages\
**Created:** [January 16, 2024, 10:32am UTC](https://forum.dynamobim.com/t/room-toelement-node/97185 "2024-01-16T10:32:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![julien.zabala](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@julien.zabala](https://forum.dynamobim.com/u/julien.zabala)\
**Post date:** [January 16, 2024, 10:32am UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/1 "2024-01-16T10:32:18Z")

</div>

Hello Community,

I’m turning to you today because I’m having a little problem with the Room To Element node…  
My aim here is to create a script that will retrieve the room name and impute it into a parameter (created for the occasion).  
I’ve done a test on a simple Revit (without a linked model) and it works very well, as shown in the following image:

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

But on a larger project with linked models, I don’t get any results (and this isn’t because the script isn’t taking the right document) and I get this:

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

We can already see that on the ʳʰʸᵗʰᵐ|Elements.GetParameterValueByNameTypeOrInstance node we don’t have the same type of result…  
I confess I’m not sure how to do this…  
And with the Element In Room node it doesn’t work with walls/floors and ceilings…

Here’s my problem, does anyone have any bright ideas?

Have a nice day 😉

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [January 16, 2024, 10:46am UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/2 "2024-01-16T10:46:42Z")

</div>

Hi,

> [@julien.zabala](#):
>
> with linked models

Are your elements in the linked model ?  
The input _RevitLinkInstance_ must be connected to the link.

---

<div class="post-metadata">

**Author:** ![julien.zabala](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@julien.zabala](https://forum.dynamobim.com/u/julien.zabala)\
**Post date:** [January 16, 2024, 11:09am UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/3 "2024-01-16T11:09:48Z")

</div>

No, All my element are in the current model… 😕

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [January 16, 2024, 1:48pm UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/4 "2024-01-16T13:48:59Z")

</div>

If I understand correctly, the rooms and tjhe elements are in the same project.

Try with a small portion of your room list and see if you get results. If so, continue with another part of your rooms list until you find the culprit.

---

<div class="post-metadata">

**Author:** ![julien.zabala](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@julien.zabala](https://forum.dynamobim.com/u/julien.zabala)\
**Post date:** [January 16, 2024, 2:45pm UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/5 "2024-01-16T14:45:26Z")

</div>

I tried with 2 parts but alas the result is the same, could it be the part?

Because I’m having trouble understanding the difference in the result at the ʳʰʸᵗʰᵐ|Elements.GetParameterValueByNameTypeOrInstance node. Any ideas?

---

<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:** [January 16, 2024, 2:49pm UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/6 "2024-01-16T14:49:45Z")

</div>

> [@julien.zabala](#):
>
> ʳʰʸᵗʰᵐ|Elements.GetParameterValueByNameTypeOrInstance

Will always get the parameter value in the current file. It also starts with instance parameters then moves to types if a parameter is not found.

---

<div class="post-metadata">

**Author:** ![julien.zabala](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@julien.zabala](https://forum.dynamobim.com/u/julien.zabala)\
**Post date:** [January 16, 2024, 3:21pm UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/7 "2024-01-16T15:21:16Z")

</div>

Ok I understand the problem and how to get around 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:** [January 16, 2024, 4:11pm UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/8 "2024-01-16T16:11:17Z")

</div>

Is this the same machine and the same version of Revit/Dynamo? Can you copy the contents of the `Room ToElement` node and run it in the workspace to get whatever errors it’s running into?

---

<div class="post-metadata">

**Author:** ![julien.zabala](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@julien.zabala](https://forum.dynamobim.com/u/julien.zabala)\
**Post date:** [January 16, 2024, 5:37pm UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/9 "2024-01-16T17:37:50Z")

</div>

Yes all the same 😕  
Do you want the script?

---

<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:** [January 16, 2024, 6:20pm UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/10 "2024-01-16T18:20:13Z")

</div>

Have you pulled out the contents of the custom node to see what the error is? That should tell you what the issue is and give us a much better idea of what needs to happen.

---

<div class="post-metadata">

**Author:** ![julien.zabala](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@julien.zabala](https://forum.dynamobim.com/u/julien.zabala)\
**Post date:** [January 17, 2024, 7:21am UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/11 "2024-01-17T07:21:33Z")

</div>

I’m afraid I don’t understand ahah  
Do you want the contents of the Python Script?

I don’t get any error message ☹

---

<div class="post-metadata">

**Author:** ![julien.zabala](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@julien.zabala](https://forum.dynamobim.com/u/julien.zabala)\
**Post date:** [January 17, 2024, 7:51am UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/12 "2024-01-17T07:51:23Z")

</div>

Is it possible that this is due to the fact that there is a linked model?

---

<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:** [January 17, 2024, 4:10pm UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/13 "2024-01-17T16:10:51Z")

</div>

You can edit a custom node by double clicking on it. This will open up the node workspace with all of the contained nodes (which may just be a single python node with inputs and outputs). You can copy all of those nodes back into your graph workspace and run them like normal. Sometimes you have to adjust your input list structure if the custom node handles lists automatically, but you can then run the graph and see what errors you’re having with the custom node contents.

Having a linked model won’t change anything unless the rooms are from the linked model, which you stated they were not.

---

<div class="post-metadata">

**Author:** ![julien.zabala](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@julien.zabala](https://forum.dynamobim.com/u/julien.zabala)\
**Post date:** [January 18, 2024, 7:35am UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/14 "2024-01-18T07:35:39Z")

</div>

Ah yes super I had not understood sorry 🙂  
Here’s the mistake it made

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

---

<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:** [January 18, 2024, 2:46pm UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/15 "2024-01-18T14:46:56Z")

</div>

Remove the input code blocks and replace them with your actual inputs. It would also help if we could see the whole code instead of just some of it. Copy/paste the python code as preformated text so we can read it.

---

<div class="post-metadata">

**Author:** ![NERDASORUS](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@NERDASORUS](https://forum.dynamobim.com/u/NERDASORUS)\
**Post date:** [January 18, 2024, 3:23pm UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/16 "2024-01-18T15:23:00Z")

</div>

> [@julien.zabala](#):
>
> oday because I’m having a little problem with the Room To Element node…  
> My aim here is to create a script that will retrieve the room name and impute it into a parameter (created

Im using the “Element ToRoom” node in my script that gets the room number (rooms are in a link) and assign the value to a parameter for elements (elements in current model) inside that room.  
its working fine, and the models are quite large.

I dont know though if this is exactly what you want, or have i misunderstood you.

On the other hand, there is a node in BIMORPH package called “BoundingBox.GetElementssInside” should also do the trick, might be worth it to check it out.

---

<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:** [January 18, 2024, 4:44pm UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/18 "2024-01-18T16:44:06Z")

</div>

Please use preformatted text (`</>`) for code, otherwise the formatting is lost and the code is worthless. Also show us the inputs you’re providing the node. We need _all_ the context of what’s going on, not just some of it.

You’re getting a null reference. You have at least one instance of an invalid object somewhere.

---

<div class="post-metadata">

**Author:** ![julien.zabala](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@julien.zabala](https://forum.dynamobim.com/u/julien.zabala)\
**Post date:** [January 22, 2024, 8:01am UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/19 "2024-01-22T08:01:00Z")

</div>

> <https://github.com/albandechasteigner/GeniusLociForDynamo/blob/master/Nodes/Room%20ToElement.dyf#L37>

Hello, here is the code 🙂  
And here’s the photo of the info I give to the nodes 🙂

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/0/20ae4e083f242ac101b4a0796954729f17378338.png)

---

<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:** [January 22, 2024, 8:54am UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/20 "2024-01-22T08:54:42Z")

</div>

Can you replace the failing node with the contents from the custom node? This will help identify where the issue is.

---

<div class="post-metadata">

**Author:** ![julien.zabala](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@julien.zabala](https://forum.dynamobim.com/u/julien.zabala)\
**Post date:** [January 22, 2024, 9:25am UTC](https://forum.dynamobim.com/t/room-toelement-node/97185/21 "2024-01-22T09:25:26Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/5/953be895d93d39981d10e0cc28a43bbad6bfd89b.png)  
Here’s the error when I make your solution 😕

[Next page](https://forum.dynamobim.com/t/room-toelement-node/97185.md?page=2)
