On Error Resume Next Dim acadapp As AcadApplication Set acadapp = GetObject(, "autocad.application") If Err Then Err.Clear Set acadapp = CreateObject("autocad.application") acadapp.Visible = True If Err Then MsgBox Err.Description Exit Sub End If End If Dim acaddoc As AcadDocument Set acaddoc = acadapp.ActiveDocument
acaddoc.sendcommand "_UCS" & vbCr & "y" & vbCr & "" |