Define a Zoom Window

AutoCAD ActiveX

 
Define a Zoom Window
 
 
 

You can quickly zoom in on an area by specifying the corners that define it. To zoom in on an area by specifying its boundaries, use either the ZoomWindow or ZoomPickWindow method. The ZoomWindow method allows you to define two points representing the Zoom window programmatically. The ZoomPickWindow method requires the user to pick two points. These two picked points become the Zoom window.

Zoom the active drawing to a window defined by two points

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