in AutoCAD, you use the Window option of the ZOOM command to define the area of the drawing that should be displayed in the drawing window. When you define the area to be displayed, the Width and Height properties of the current view are adjusted to match the area defined by the two points specified. Based on the specified points, the CenterPoint property of the view is also moved.
在 AutoCAD 中,用户使用 ZOOM 命令的窗口选项定义图形窗口中应该显示的图形的区域。当定义显示的区域后,当前视图的 Width 和 Height 属性会通过两个指定的点调整为与定义区域相匹配。根据指定的点,视图的 CenterPoint 属性也会被改变。
This example code demonstrates how to zoom to a defined area using the Zoom procedure defined under Manipulate the Current View. The Zoom procedure is passed the coordinates (1.3,7.8,0) and (13.7,-2.6,0) for the first two arguments to define the area to display.
本例代码演示如何使用 操作当前视图 部分定义的 Zoom 过程缩放定义的区域 。Zoom 过程通过传递坐标(1.3,7.8,0) 和 (13.7,-2.6,0) 作为前面的两个参数来定义显示区域。
No new center point is needed, so a new Point3d object is passed to the procedure. The last argument is used to scale the new view. Scaling the view can be used to create a gap between the area displayed and the edge of the drawing window.
不需要新的中心点,所以只给过程传递了一个新的Point3d对象。最后的参数用于缩放新视图。缩放视图可以在显示区域和图形窗口边缘之间创建一个间隙。
<CommandMethod("ZoomWindow")> _
Public Sub ZoomWindow()
''通过(1.3,7.8)和(13.7,-2.6)定义的边界缩放窗口 Zoom to a window boundary defined by 1.3,7.8 and 13.7,-2.6
Dim pMin As Point3d = New Point3d(1.3, 7.8, 0)
Dim pMax As Point3d = New Point3d(13.7, -2.6, 0)
Zoom(pMin, pMax, New Point3d(), 1)
End Sub
[CommandMethod("ZoomWindow")]
static public void ZoomWindow()
{
//通过(1.3,7.8)和(13.7,-2.6)定义的边界缩放窗口 Zoom to a window boundary defined by 1.3,7.8 and 13.7,-2.6
Point3d pMin = new Point3d(1.3, 7.8, 0);
Point3d pMax = new Point3d(13.7, -2.6, 0);
Zoom(pMin, pMax, new Point3d(), 1);
}