I want to create a script that inserts value to a property related to the components that identifies which room number the component is placed in…

Basicaly Room number in which the component is placed should be the input value of the property - lets call this “Room Placement”.

For example if we place a Fridge in a room number = “GR9”. Then the value in Fridge property Room Placement should be “GR9”. But the value input must be dynamic - so if i move the Fridge to another room - the value in RoomPlacement should update according to that room number.

I have tried the following script:

but i get following error:
“BoundingBox.GetelEmentsIntersect Could not load type”

any suggestions?

1 Like

@Dims ,

i did it this way! Element.Geometry is the key!



1 Like

Best to not bounding boxes here, are rooms are rarely square throughout.

Instead get the element’s location, then If the element is curve based find the mid point, and finally get the room at that point. This will find the room which contains the midpoint of curve based elements, or the insertion point of point based ones.

Even easier for most loadable families you can likely use the room location point and utilize the live room data in a schedule view to tie things together.

1 Like

thanks for your proposals guys. Turns out i needed to update the package… The above solution previously posted by me seems to be working fine now.