有#039;这是几个API,你可以看看。下面的子项添加了点,但方向相反
- Declare Function SetCursorPos& Lib "user32" (ByVal X As Long, ByVal Y As Long)
- Type POINTAPI
- X As Long
- Y As Long
- End Type
- Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As POINTAPI) As Long
- Private Declare Sub sapiSleep Lib "kernel32" _
- Alias "Sleep" _
- (ByVal dwMilliseconds As Long)
- Sub XC()
- Dim i As Integer
- Dim Pt As AcadPoint
- Dim P(2) As Double
- For i = 1 To 5
- sapiSleep (500)
- Dim cpos As POINTAPI
- GetCursorPos cpos
- P(0) = cpos.X: P(1) = cpos.Y
- Set Pt = ThisDrawing.ModelSpace.AddPoint(P)
- Pt.Update
- Next
- End Sub
|