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.

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.

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

Hi @T_Pover ,

I recently used this script with your node in and it destroyed my spaces which is frustrating as i have been using this node for ages and it has been working like a dream. Have you changed anything recently and can you confirm please that it is still working as intended for Revit 2020. I pretty much copied the script above

Thanks in Advance


I’ve had similar experiences with that node. Try MEPSpaces.CenterSpace from the QuasarII package.

Thanks JCPahlow,

I will have a look at this node now and let you know how I go.