CalculateSpatialElementGeometry Method


Compute the spatial element geometry and returns the boundary face information.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2012

Syntax

C#
public SpatialElementGeometryResults CalculateSpatialElementGeometry(
	SpatialElement spatialElement
)
Visual Basic
Public Function CalculateSpatialElementGeometry ( _
	spatialElement As SpatialElement _
) As SpatialElementGeometryResults
Visual C++
public:
SpatialElementGeometryResults^ CalculateSpatialElementGeometry(
	SpatialElement^ spatialElement
)

Parameters

spatialElement
Type: Autodesk.Revit.DBSpatialElement
Specifies the spatial element needs to be computed, should be Room or Space.

Return Value

Requested boundary face information.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException spatialElement is not a room or a space, and thus has no 3D geometry to calculate. -or- spatialElement is not enclosed in 2d or has no location, or the height is too small, and thus has no 3D geometry to calculate.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsInvalidOperationException Failed to compute the given spatial element's geometry.

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →