Create a level global variable

Hello, I would like to have a global variable who is a level of my project.

For this, I would like to select one level on my Revit project on the beginnig of my Dynamo script (for example a level named : “RDC” or “R+1”) and I will can reuse this choice later on my Dynamo Script.

The target of this is to don’t have long link who passed allong my script and have only one choise on the Dynamo Player.

I looking forward your anwsers.


Apologies I’m not at a PC. I suspect you could use a function to do a similar job, like in this post…

Michael Kirschner states later on that you would need a C# node otherwise. I think I also saw a solution somewhere that involved writing/reading a text file.

Hope that helps,


Thanks for your response. :wink:

That’s what I’ve been trying to do. Do you have an idea of what would have to be written in the code block to get my level and then be able to reuse this information ?

Hi Baptiste,

Use the Select.GetLevelByName node of archilab package.

Ok, Thanks for your help but how I can reuse later the value of this node ?

The idea is to select only one level on the Dynamo player and this choice is use on multiple location into the script.

You can use this suggestion from another post, using spring nodes package.
So you would have something like this.

You might even be able to get away with not putting the boolean for refresh if it’s only going to be used in dynamo player, since it refreshes the script automatically.

Like this? :slight_smile:

Node to Code is very handy…

But I don’t think you can input ‘Level 1’ from Player… I think all the variables of the function exist inside itself… I also think you can’t write a function for design script in a string anywhere… Other people might know more than me though…

I think the string writing method is probably what you’re after.

Hopefully that’s of interest,



Thanks for your answer. :wink:

Would it be possible to plug a input to the function ?

On the same idea as the following capture :