Set Parameter Depend on the Levels with Dynamo

You could take a look at Element.FilterByLevel (Chynamo package) for instance. If you double-click on it, you will see how it is build. See also here: