Room ToElement node

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:

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:

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 :wink:


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

No, All my element are in the current model… :confused:

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.

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?

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.

Ok I understand the problem and how to get around it?

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?

Yes all the same :confused:
Do you want the script?

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.

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

I don’t get any error message :frowning:

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

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.

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

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.

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.

1 Like

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.

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

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

Here’s the error when I make your solution :confused: