定义到窗口 (.NET)
在 AutoCAD 中,可以使用 ZOOM 命令的“窗口”选项来定义应在图形窗口中显示的图形区域。定义要显示的区域时,将调整当前视图的 和 属性以匹配由指定的两个点定义的区域。根据指定的点,视图的属性也会被移动。WidthHeightCenterPoint 缩放到由两点定义的区域此示例代码演示如何使用“操作当前视图”主题中定义的缩放过程缩放到定义的区域。Zoom 过程为前两个参数传递坐标 (1.3,7.8,0) 和 (13.7,-2.6,0),以定义要显示的区域。 不需要新的中心点,因此将新的 Point3d 对象传递给过程。最后一个参数用于缩放新视图。缩放视图可用于在显示的区域和绘图窗口的边缘之间创建间隙。 VB.NET<CommandMethod("ZoomWindow")> _ Public Sub ZoomWindow() '' 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 C#[CommandMethod("ZoomWindow")] static public void ZoomWindow() { // 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); } VBA/ActiveX 代码参考Sub ZoomWindow() Dim point1(0 To 2) As Double Dim point2(0 To 2) As Double point1(0) = 1.3: point1(1) = 7.8: point1(2) = 0 point2(0) = 13.7: point2(1) = -2.6: point2(2) = 0 ThisDrawing.Application.ZoomWindow point1, point2 End Sub 父主题: |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 22:03
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.