ZoomAndCenterRectangle Method


Zoom and center the view to a specified rectangle.

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2013

Syntax

C#
public void ZoomAndCenterRectangle(
	XYZ viewCorner1,
	XYZ viewCorner2
)
Visual Basic
Public Sub ZoomAndCenterRectangle ( _
	viewCorner1 As XYZ, _
	viewCorner2 As XYZ _
)
Visual C++
public:
void ZoomAndCenterRectangle(
	XYZ^ viewCorner1, 
	XYZ^ viewCorner2
)

Parameters

viewCorner1
Type: Autodesk.Revit.DB XYZ
A corner of the desired view rectangle in model coordinates.
viewCorner2
Type: Autodesk.Revit.DB XYZ
The opposite corner of the desired view rectangle in model coordinates.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The view corner points must differ when projected onto a plane perpendicular to the view direction.
Autodesk.Revit.Exceptions InvalidOperationException The view is not a graphical view.

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →