I know this isn't good idea to use SendCommand
but this code is working for me:
Code:
Option Explicit
Sub MoveEnt()
Dim oEnt As AcadEntity
Dim pickPt As Variant
Dim fpt As Variant
Dim osm As Integer
On Error GoTo Err_Control
ThisDrawing.Utility.GetEntity oEnt, pickPt, vbCrLf & "Select object to move >> "
If oEnt Is Nothing Then Exit Sub
On Error GoTo Err_Control
With ThisDrawing
osm = .GetVariable("OSMODE")
.SetVariable "OSMODE", 513 '// <-- change snap setting to your needs
fpt = .Utility.GetPoint(, "Pick first point")
If IsEmpty(fpt) Then
GoTo Exit_Here
End If
End With
Dim strh As String, strp1 As String
strh = oEnt.Handle
strp1 = Replace(CStr(fpt(0)), ",", ".") & "," & _
Replace(CStr(fpt(1)), ",", ".") & "," & _
Replace(CStr(fpt(2)), ",", ".")
ThisDrawing.SetVariable "CMDECHO", 0
ThisDrawing.SendCommand "-OSNAP _NONE "
ThisDrawing.SendCommand "_MOVE " & _
"(handent " & Chr(34) & strh & Chr(34) & ")" & vbCr & _
vbCr & strp1 & vbCr & "pause" & vbCr
Exit_Here:
With ThisDrawing
.Regen acActiveViewport
.SetVariable "OSMODE", osm
.SetVariable "CMDECHO", 1
End With
Err_Control:
If Err.Number <> 0 Then
MsgBox Err.Description
Resume Exit_Here
End If
End Sub
~'J'~