How to get linked wall hosted elements by rooms

Hello guys.

I’m trying to write a script to get linked elements by rooms. I first got the linked elements within a room by using the centroid of their bounding box and checked if it exists in the room (IsPointInRoom). However, I got some elements that belongs to none of the rooms. I’m assuming they must be hosted on walls/boundaries of rooms.
Any ides on how I could get the intersection between the elements’ bounding boxes and the boundaries of the rooms? Is there any other way of getting the elements?

Hi @zouhair-salma,

You can try with the Room ToElement node which does not use bounding boxes.
Room ToElement