How To Query Room Properties

Once a room is defined you can access information about that room and use it to define the size and shape of other rooms.

It will often be necessary for you to make the size and location of rooms dependent on each other. You can access information about the rooms bounding box in the following way.

Minimum and Maximum Values

Rooms are stored in an array called rooms[] properties can be accessed with the name property. In this example, we access the maximum and minimum x and y values for a room called "livingroom".

rooms['livingroom'].left
rooms['livingroom'].right
rooms['livingroom'].bottom
rooms['livingroom'].top

You can use this information to define the maximum and minimum values of another room's diagonal.

    "diagonal": [
      "[rooms['livingroom'].left, rooms['livingroom'].bottom",
      "[-4, [3, 4]]",
    ]

Corner Values

You can also access the (x,y) coordinates for each corner of your room. Corner IDs progress clockwise in the same order as the room segments.

Corners are accessed the same as the .left, .right, .top and .bottom values. Use your room name to access the room in the rooms[] array. Corners are stored in the .corners[] property. You will use a unique id to retrieve the (x,y) value for each corner.

rooms['livingroom'].corners[3]

Last updated