'Get surrounding elements' node detects more elements than necessary

Can someone tell me what’s wrong with my script or with my project?
I’m trying to send information from my rooms to the ceilings, but for an unknown reason the ‘getsurroundingelements’ node gives me more rooms than I expected:

Is there something wrong with the script or is there something not correct in my model?
Files: https://www.dropbox.com/sh/akfpkk1utjctuoz/AABcMR53rBOBQgsrdOdfGEYea?dl=0

Hi, Get Surrounding Elements seems to use a bounding box method:

There;s also a good method of using Raybounce to grab ceilings discussed here.

1 Like

@Yna_Db, does this means that the Get Surrounding Elements doesn’t work for non-rectangular rooms?

@john_pierson, I’ve tried to modify your script so that it works for all rooms in my project, without selecting them, but than I get following error:

Are all of the rooms reporting a location? You may need to filter out unplaced rooms first.