Renaming elementmarks inside walls by wall name (mark)

Hello Dynamo Users, I am new to the use of Dynamo and I am researching the program in case of my study Building Engineering in the Netherlands. At this moment I would like to extract elements from concrete walls and mark these elements with the same mark as the wall got. The walls will get their mark by a script that sorts them by a mass which is the size of each house. I turn every mass and walls into a bounding box and compere if the intersect. When they do intersect the markparameter will be reset to the correct wallmark.

After that is done I would like to find all elements inside each wall and rename them with the same wallmark. Until this part everything works fine. I found a couple of things on the forum but couldn’t find the right thing for me. I use the FamilyInstance.Location to find the element location inside the boundingbox of each wall. But somehow a couple of elements get picked up by the wrong walls. This is visible in the screenshots below.

 

The lower wall got mark 118 the upper wall got mark 114. The element I got selected in the RVT screen should got mark 118. What could be the problem here?

 

Best regards, Vincent Olthuis (Excuses for my English)

<!–more–>Here are the pictures without a cropview

 

Vincent Olthuis

Is there anyone able to help me solve this challenge? Regards, Vincent Olthuis