GetRoomAtPoint Method (XYZ)
Gets a room containing the point.

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

Syntax

C#
public Room GetRoomAtPoint(
	XYZ point
)
Visual Basic
Public Function GetRoomAtPoint ( _
	point As XYZ _
) As Room
Visual C++
public:
Room^ GetRoomAtPoint(
	XYZ^ point
)

Parameters

point
Type: Autodesk.Revit.DB..::..XYZ
Point to be checked.

Return Value

The room containing the point.

Remarks

Surveys only the rooms from the final phase of the project. The first one found will be returned. If there is no room containing the point, it returns nullNothingnullptra null reference (Nothing in Visual Basic).

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentNullException Thrown when the point is nullNothingnullptra null reference (Nothing in Visual Basic).
Autodesk.Revit.Exceptions..::..ArgumentException Thrown when the coordinates of the point are not number or are Double::MaxValue or Double::MinValue.

See Also