GetParameters of entrance doors in detail sketch, ONLY if they are inside trimmed plan area

Hello and thank you for your time and input!

We are currently creating flat sales plans and for the naming of the plan header and labelling fields we would like to read out the flat number, which is stored as a parameter in each flat entrance door (this type only exists once per flat, and got a string sequence in it´s name for filtering purposes).

However, the problem is that we create floor plans as a detail sketch in Revit and then define a cropping area so that only the flat in question is shown in order to load it into the plan later.
However, if I now read out the doors from the floorplanview associated with this and then looped over these elements with a PythonScript by using this condition:

if “EINGANG” in str( |typnames of doors|)

I get more entrance doors, than number of flats (60 <-> 40) because the Select.ByCategoryAndView node refers to the floorplan area that has not been trimmed and therefore also reads out doors that are outside the trimming area but within the floorplan.

What are the possible solutions here?

I have therefore captioned it with a few screenshots. If you need the script just tell me, than i will separate this part and provide it as attachement.

Food for thought

I did (made) something similar except i use Model Groups.
Each flat is a Model Group.The Model Groups have Parameters attached to it
(like number, if it is for rent or sale etc.).
With Dynamo i create a Floor Plan for each flat (i use the Model Group BoundingBox for the crop).