Filter imported text elements by level

I’m trying to make a script that renames revet rooms based on roomnames on a DWG, but I don’t know how to filter the text elements by level. The DWG is exploded. What can I do?

I solved this by just using “select model element” manually for each floor.