Revit 2025.3 API
Spatial |
Gets the default location of the spatial element.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public XYZ GetDefaultLocation()
Public Function GetDefaultLocation As XYZ
public: XYZ^ GetDefaultLocation()
member GetDefaultLocation : unit -> XYZ
Return Value
XYZThe default location of the spatial element.

Exception | Condition |
---|---|
InvalidOperationException | The spatial element does not have a valid default location. |

The default location is a point where a spatial element is placed when it is created automatically without specifying a point.
The default location of a spatial element is identical to the center of the bounding box if it is located inside the boundary,
otherwise Revit will try to find a point that is guaranteed to be inside the boundary using an internal algorithm.
See Also