Level cleanup in Dynamo

New Dynamo user here. I noticed there are a number of threads that attempted to do the following scenarios in Revit:

Select all items that pertain to a level
Change level parameter to new level

This is intended to help aid in cleaning up unwanted levels in Revit documents. I am SURE Dynamo can do this quickly, but I am extremely new to this programming type and I am a little lost. From a previous thread, I have programmed the following:

I am unsure where to go from here. According to the programming theory, the node “Element.SetParameterByName” should be re-assigning the node level to the level connected to it, but my Watch box shows nothing.

To boot, my first Watch box shows nothing being selected as well.

I believe this would be an amazing tool to help revit users, but I need your help to make it happen.


1 Like

Hi John,
According to your screenshot your getting “Empty List” at “All elements at Level” node. Could you drop dummy rvt file so that we can have closer look at it.

I would upload the code and revit model, but I am not allowed to per me being a “new user”.

It is very easy to re-create. Once again, this is what I want it to do:

  1. Select all items on a level.
  2. Switch levels from the current level to another existing level I want to make it.

Is there any other way I can help you help me that doesn’t involve uploading items?

You can upload files in dropbox or google drive and drop the link here.

@Theferrell The problem is specific to your file as you seem to have no elements on the selected level.
Recreating the file will serve no useful purpose.
You could consider posting a link to the file uploaded on Drive, Dropbox, etc…

1 Like


Ok, try this out.

The actual file I want to use it for is over 100 megabytes, but since I want this to be a universal code, I think it should work with my trial file.

The file only has two beams located on Level 1. I want the code to make them associated with Level 2.

Thanks for your patience!!

Beams are associated with Reference Levels, not Levels
As this is a test, try using some other elements and see if it works.

I tried using some other items like a floor and a column, and noticed that they all have a different parameter name to associate it with a level.

I tried to ammend the Code Box node to say “Reference Level” to try to get Dynamo to look at the Reference Level parameter, but no dice.

Isn’t there a way to make Dynamo show all available parameters and get it to pick items associated that have any items that have to do with levels?

Even if there isn’t there are still only a limited number of element types you’d have to manage.

Selection Master

I found a great $30/year add-on to Revit that does EXACTLY what I wanted it to do. First off, it allows you to select everything to do with a specific layer. There’s a bunch of other filters on it, but that’s a biggie for me.

It also has an awesome tool that does EACTLY what I first proposed which was to change objects from one level to another without changing the elevation. Well, to be truthful, it kinda breaks down with walls, or any other element that has a base and top offset, but for my drawing it wasn’t too many items so I fixed those manually. It helped clean my level issue within 30 minutes.

I still hope we can find a way to make this work in Dynamo because, first, coding stuff yourself is way cooler than shelling out dough for someone else’s work. Second, I know this is a massively unresolved issue so if anyone can help me make this dream a reality, please chime in!!

This post is for those who stumble upon this topic in case it is never resolved.

1 Like