Room Names to Elements using Dynamo

Hello everyone, this is my first request for help and forgive me if I don’t know exactly the procedures. I have a problem I would like to set the name of the rooms in the cable trays, but all the nodes I have used do not work could you help me.
thank you in advance to anyone who can help me

That’s probably because Cable Trays are not “room sensing”; meaning they don’t know which Room or Space they are inside. Unlike Furniture or Casework for example.

You probably need to get a point from your trays and see if that point is inside a Room. There are some standard nodes that might help you out there. There is probably another post about this in the forum somewhere if you search around a bit.

Thank you, very kind!
I found this solution, it seems to work.

Happy that it helped - personally I’d be a little bit careful using Bounding Box since it’s axis-aligned, which might create odd results depending on the angle of your Cable Trays or the shape of the Rooms.

You might also need to consider Cable Trays crossing several Rooms.