Revit Level change with dynamo script

I open a Revit level in a project to select all elements of a category. I have a Dynamo script that selects all elements of a category via the Data-Shapes pakete ListView.

I now want to switch levels without closing the Dynamo script, so that I can select the desired elements here as well, which will then all be displayed in the ListView. Can I do this without using Python nodes, or do I need them?

Thank you for your help.

Timo

Elemente_auswaehlen_view_Form1.dyn (35.2 KB)

Why not make your script in such a way so you can pick the Levels too with like a tick box?

That’s exactly what I want to do, but I can’t figure out which node to use for it. Would the ListView node be sufficient?

Yes. ListView from Data-Shapes gives you a selection box for each item in your ListView. You just feed in the level name as the keys and the level objects themselves as the values. That should return the list of level elements you select in the UI.

A screenshot of your graph in action might be helpful.

Here a pic to selecte the level an selecte the windows, after this we want to change to the next level and selecte the windos again on this level and work with them.

So you want to run the graph a second time?

Why not just use player and do that if so?

1 Like

Gotcha. So you’re not automatically selecting all windows from the selected levels. You want to select a Level from the UI, list out the available Windows from that Level in another UI selection, select the Windows you want to include, and then repeat the process for another Level. Is this because you need to execute logic for the entire selection as a group or is this just to make it faster for automating multiple levels one by one? If you just want to do one level after another, just run your script in Dynamo Player - execute one level, then execute again with a different level.

If you need to manage multiple levels at once, you’ll want to rethink your UI logic. Rather than looping through Level and Window selections independently, just select from everything all at once. Select from a ListView of all available Levels, then collect and list all Windows from the selected Levels in a new ListView. This way you only execute the UI logic once, but can select from multiple Levels at the same time.

I would do it like this tbh (select the windows on selected Levels),
but maybe your worklow doesn’t allow for that(?).

Sounds like the workflow becomes “all elements of category” windows.

Then “select levels” with the Datashapes UI nodes.

Then filter by bool mask to remove windows which are not on the selected level.