Starting with Revit 2013, the UIView class was introduced to manage view controls and retrieve view-related information.
UIView.GetWindowRectangle returns the drawing area’s extent, with coordinates specified in screen coordinates.
UIView.GetZoomCorner() provides the drawing area’s extent using coordinates in the model’s coordinate system.
By comparing these two sets of data, you can calculate the relationship between model coordinates and screen coordinates.
To address the task of implementing a window zoom view, the following function can be used:
public void ZoomAndCenterRectangle(
XYZ viewCorner1,
XYZ viewCorner2
)
Using UIDocument.GetOpenUIViews, you can retrieve the UIView objects for all views currently open in the model file.
Note that views which are not open do not have corresponding UIView objects.














Must log in before commenting!
Sign Up