把以下代码写入到模块中运行就可以了:
- Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
- Private Const VK_ESCAPE = &H1B
- Sub zc()
- On Error Resume Next
- Dim vhight As Double
- Dim Center As Variant
- Center = ThisDrawing.Utility.GetPoint(, "选择缩放的中心点:")
- vhight = ThisDrawing.GetVariable("viewsize")
- GetAsyncKeyState VK_ESCAPE
- Do
- ZoomCenter Center, vhight
- If GetAsyncKeyState(VK_ESCAPE) <> 0 Then
- Exit Do
- Else
- vhight = vhight + 0.1
- End If
- Loop
-
- End Sub
|