Room.CenterBoundary equivalent


I want to use the Room.CenterBoundary but with MEP Space.

I tried to get element geometry, then boundary but i can’t find the center boundary.

How could I do a work around to get this ?

Try this,


Hello Steven, thank you for your reply but in this projet we use MEP Spaces instead of Rooms.

So I managed to do it this way :

Is that giving you what you want? A bounding box would is just that a square box. Room.CenterBoundary is the center line of the rooms bounding elements and will hold true to the shape of the room.

I was thinking you could pull the rooms from the architecture model like this. (I think you need archi-lab and springs.nodes)

If what you are doing is giving you the results you need then please mark this post as solved.

Yes, thanks to the node “BoundingBox.PerimeterCurvesByNormal”.

I will mark it up.

Thank you !

Starting with Dynamo 2.6 (I believe) Space.CenterBoundary as well as others are included. However, I needed to replicate Space.Boundary node functionality with a Python script for backward compatibility. The heavy lifting in the script is done by GetBoundarySegments with the applicable SpatialElementBoundaryOption set.

# References

# Load the Python Standard and DesignScript Libraries
import clr
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import System
from System import Array
from System.Collections.Generic import *
from Autodesk.DesignScript.Geometry import *
import Revit
import RevitServices
from RevitServices.Persistence import DocumentManager 
from RevitServices.Transactions import TransactionManager 


import Autodesk 
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication 
app = uiapp.Application 
uidoc = uiapp.ActiveUIDocument

# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN[0]

# Place your code below this line
# Unwrap
spaces = UnwrapElement(dataEnteringNode)

# Arrays
curves = []
boundaries = []

# Boundary options for spaces
opt = SpatialElementBoundaryOptions()
# Set spatial boundary location option to 'Spacial element centerline.'
# Boundary location enumeration:
# enumeration=[Finish,Center,CoreBoundary,CoreCenter]
opt.SpatialElementBoundaryLocation = SpatialElementBoundaryLocation.Center
# Iterate through every space and find boundary curves
for space in spaces:
	rvBoundary = space.GetBoundarySegments(opt) # Get space boundary
	dsBoundary = [] # A Dynamo list to hold the boundary per space remember it can be complex, with holes		
	for rvLoop in rvBoundary: # For each loop in the space boundary
		dsLoop = [] # A list to hold each space's loop
		for rvPiece in rvLoop:	# Retrieve each segment of the loop
			dsPiece = Revit.GeometryConversion.RevitToProtoCurve.ToProtoType(rvPiece.GetCurve(),True) # Read the segment as Curve and convert to Dynamo geometry
			dsLoop.append(dsPiece) # Add the piece to the Dynamo Loop
		dsBoundary.append(dsLoop) # Add the Dynamo Loop to the Dynamo Boundary
	curves.append(dsBoundary) # Add the Dynamo Boundary per space to the Curves list
# Iterate through list of curves and make polycurve
for curve in curves:

# Assign your output to the OUT variable.
OUT = boundaries

Fairly straight forward but a little tough to find guidance on mechanics to set the applicable SpatialElementBoundaryOption.