' 功能:判断用户是否按下某一个键
' 输入:代表键的常量(从API Viewer中获得)
' 调用:API函数GetAsyncKeyState
' 返回:如果用户按下了指定的键,返回True;否则返回False
Private Function CheckKey(lngKey As Long) As Boolean
If GetAsyncKeyState(lngKey) Then
CheckKey = True
Else
CheckKey = False
End If
End Function
' 判断用户是否按下了Esc键
If CheckKey(VK_ESCAPE) = True Then
MsgBox "结束! "
Exit Sub
End If
Sub test()
Dim mc As mcArxProject1Lib.Curve
Set mc = New mcArxProject1Lib.Curve
Dim v As Variant
v = mc.getEndPoint(ThisDrawing.ModelSpace(0))
End Sub
ARX的COM调用。