If you can not schedule element by level because you can not find the proper parameter in the list, you can follow this script.
This script will create a new project parameter and it will detect the element level according to the absolute height from the 0. The script gives you the freedom to choose a portion of the elements or you can run a script for the chosen element category.
Because this script checks the real elevation of the element, even elements with the wrong reference level will have the correct value in the new project parameter.
Please make sure that before you start using this script that you back up your existing project model.
Also, if you want to download this (and all other scripts) with my sample files please visit the Shop page.
The script uses the following Dynamo packages: Data-Shapes v.2019.2.42 Clockwork v.2.3.0 GeniusLoci v.2020.8.20 archilab v.2021.25.4
I installed the 4 required packages:
Data-Shapes v.2019.2.42
Clockwork v.2.3.0
GeniusLoci v.2020.8.20
archilab v.2021.25.4
On dynamo 2.0.4 and revit 2018?
but the code did not run
It is probably Data-Shapes package. I think that Data-Shapes package does not eork on Revit 2018. In my video I did use Revit 2020.2.
Can you confirm the Dynamo version number you are using? I am using Dynamo Core 2.1 and Dynamo Revit 2.1 (and Revit version 20.0).
Regarding the Revit version you can see that in every video when Revit window is visible (just take a look at the top middel text of Revit window). On the other hand each Revit version is followed by specific Dynamo version. More about that you can see here: https://primer.dynamobim.org/08_Dynamo-for-Revit/8-1_The-Revit-Connection.html