那么这个代码剪报呢:
- Option Explicit
- Sub dragText()
- Dim oEnt As AcadEntity
- Dim oText As
- AcadText
- Dim pickPt As Variant
- Dim cmd As
- String
- ThisDrawing.Utility.GetEntity oEnt, pickPt, vbCrLf & "Select
- text"
- If Not TypeOf oEnt Is AcadText Then
- Exit Sub
- End If
- Set oText
- = oEnt
- Dim basePt As Variant
- basePt = oText.InsertionPoint
- ' you have
- as well to specify base point before,
- 'basePt = .GetPoint(pickPt, vbCrLf
- & "Specify a base point : ")
- Dim hdl As String
- hdl =
- oEnt.handle
- Dim pt As String
- pt = "(list " & Replace(CStr(basePt(0)),
- ",", ".") & " " & Replace(CStr(basePt(1)), ",", ".") &
- Replace(CStr(basePt(2)), ",", ".") & ")"
- cmd = "(command " & Chr(34)
- & "_move" & Chr(34) & " (handent " & Chr(34) & hdl &
- Chr(34) & ") " & vbCr & Chr(34) & Chr(34) & pt & vbCr
- & "PAUSE)" & vbCr
- ThisDrawing.SendCommand cmd
- 'just a dummy message to stop command echoing:
- MsgBox "pokey"
- End Sub
|