定义“缩放”窗口

AutoCAD ActiveX/VBA

 
定义“缩放”窗口
 
 
 

可以通过指定定义区域的角点快速放大该区域。要通过指定边界来放大某个区域,请使用 ZoomWindow 或 ZoomPickWindow 方法。ZoomWindow 方法使用户可以通过编程的方式定义代表“缩放”窗口的两个点;ZoomPickWindow 方法则要求用户拾取两个点。这两个拾取点将形成“缩放”窗口。

将活动图形缩放至两点定义的窗口

Sub Ch3_ZoomWindow()
    ' ZoomWindow
    MsgBox "Perform a ZoomWindow with:" & vbCrLf & _
           "1.3, 7.8, 0" & vbCrLf & _
           "13.7, -2.6, 0", , "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
    ' ZoomPickWindow
    MsgBox "Perform a ZoomPickWindow", , "ZoomPickWindow"
      
    ThisDrawing.Application.ZoomPickWindow
End Sub