Reorients the view to align with the forward direction.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Since:  2015

Syntax

C#
public void OrientTo(
	XYZ forwardDirection
)
Visual Basic
Public Sub OrientTo ( _
	forwardDirection As XYZ _
)
Visual C++
public:
void OrientTo(
	XYZ^ forwardDirection
)

Parameters

forwardDirection
Type: Autodesk.Revit.DB..::..XYZ
The forward direction.

Remarks

This method adjusts the ViewOrientation to align with the input forward direction. The eye position will be automatically determined based on the shape of the viewing area and size of the model. The UpDirection will be aligned with the project Z axis.

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions..::..ArgumentOutOfRangeException forwardDirection has zero length.
Autodesk.Revit.Exceptions..::..InvalidOperationException View is locked and cannot be reoriented.

See Also