Reset Space location to center of space

While the architectural floor plans shift during design, it would be nice to “reset” the center point of all the Spaces.

How can I find the space perimeter boundary as a polygon so I can then use Element.SetLocation to Polygon.Center?

The pretty sure the Room.Boundaries node in the clockwork package works with areas and rooms. It may or may not work with spaces too (i’m unable to test at the moment). Good starting point anyway.

In case you’re having trouble getting the center locations of the spaces. I have a custom node in my package ‘MEPover’ that will reset to the location of rooms or spaces for you. It doesn’t use the space boundaries to determine the center location but another method so that might work for you. Haven’t tested it a lot though, so I would love to get feedback on it if it fails.

1 Like

The Python script worked, a few spaces were deleted in the process though.

That’s good to hear. Are you sure the spaces are actually deleted though? It should return a null value if the script can’t find the center location so it just does nothing for that space.

@T_Pover
Hi, When I try using your ‘Use Room or Space Reset Center Location’ node to reset the centerpoints of Spaces, it moves all spaces to the same point, and that point wasn’t even within any of the spaces.
Revit 2018 Dynamo 2.0.1
Thanks - Rusty

That’s odd, could you share your revit file? I’d like to know what could be causing this.

@T_Pover
I found what makes it fail, and you should be able to easily reproduce it.

If there is a closed loop of room-bounding Walls and/or Room Separation lines in the area of Spaces defined by Space Separation lines, then ‘Use Room or Space Reset Center Location’ puts all of the spaces in the area bounded by those Walls and/or Room Separation lines, or in an area bounded by a combination of Walls and/or Room Separation lines and Space Separation lines (Whether or not any Rooms actually exist).

See this before and after test image:

(I sure wish Revit provided a way to have Spaces ignore Rooms, Walls and Room Separation lines.)

Thanks - Rusty

Thanks Rusty, that’s really useful to know. I’ll dig into it a bit more when I can find some time. At least we now know what’s the cause of it.

I had similar issue, turn off separation lines won’t work, well, need to find another way

@T_Pover I know it’s been a couple of years since this post was active. However, I’m having a same issue of the node resetting all the points to the same location.


As you can see the points before are at the right location but after they come out of the node they converge to a single point.

I think I managed to resolve the issue that @rgesner mentioned where all spaces are joined in a single point. The problem seemed to be that I used the level’s elevation value for checking for rooms/spaces. I have changed this so that the code now uses the level’s computation height (which is usually a bit higher than the elevation). This resolved the error in my small testing project so hopefully it will resolve something for you too. I updated the package on the package manager just now.

1 Like