Don’t reinvent the wheel. If you are trying to solve a problem, which can occur in multiple disciplines then it may be usefull to search through the Dynamo forum. Here is an example:
At my office we use SOFiSTiK Reinforcement add-in for Revit, because it automises many tasks. However, schedule all the rebars and fabric sheets can be quite difficult. The schedule function gathers all rebars which are assigned to one sheet. Therefore if you want to group all the rebars of level 1,.. into one schedule (because of estimation reasons), then you will probably loose the overview of all the rebar marks and compenents where they are part of.
So I searched Google for a solution to this and I found this link which is worth a mint: Dynamo forum link. This Dynamo graph will apply to all of your elements the sheet, where they are included. This. is. huge.
You can use this workflow to filter elements by GetParameterBy… afterwards. You can request it for example if all the rebars contains at least two sheets (one sheet where the whole level is shown, one for the component where they are part of).