Room points to find the center

HI, I’ve downloaded @Qnguyen2688 script to move room coordination point to center.
But can anyone tell me why the script can’t read the room points to find the center?


image image
image image

Are the rooms bound?

1 Like

seems your boundery have some issue, does it work if you get the room bottom surface and point on surface 0.5 or the rooms solid with a centroid [ should work in most cases depend on the room shape…and then use set location instead move by vector so you dont need transaction [what the move by vector need]

1 Like

PS and try filter out non placed rooms and nonenclosed rooms…there is an ootb node for that or filter by area there have 0 m2 in area

1 Like

I’m with @jacob.small, I suspect there are a lot of unplaced rooms in the model
Rhythm nodes also has a node Rooms.CenterRoom

There’s also an archilab node that can get rooms by level

1 Like

You’re absolutely right, it was the empty rooms that did it. Now, however, I got a different error code

image

try with element set location, so you dont need transaction

1 Like

Hmm, You mean the way I tested?

image

Hi @patric.johansson try feed in the point

1 Like

The script moves the rooms now but very many rooms I think are far from the center.
Also gets a warning

does it work if you do as here?

1 Like

Yes it centers the rooms right!!
But it ungroups rooms that I still need to have grouped.
Tips on what I should add so that it doesn’t split them?


Much simpler script this :ok_hand:

Group edit mode isn’t available via the API, so I think you’ll need to handle those separately or live with ungrouping.

1 Like

typical, have also managed to get the rooms centric with other scripts but there it ungroups rooms as well :face_with_diagonal_mouth:

Unfortunately until groups are supported via the API it’s sort of a ‘use no groups or limit your automation potential’ situation. This is the primary reason I don’t recommend them (users understanding the limitations and uses is the second).