Redefine Open command to RECOVER

We're chasing a couple of annoying bugs in BricsCAD that are avoided by auditing drawings. I'd like to redefine the OPEN command to perform a RECOVER. It seems easy enough but the recover command is not displaying the open dialog when executed as follows:

(command "UNDEFINE" "OPEN")
(defun c:open ( / ) (command "RECOVER"))

It works as expected when I type recover manually. Any ideas how I get the dialog to appear? I've already confirmed FILEDIA and CMDDIA are set to on.

Comments

  • [code](defun c:Open ()
      (setvar 'cmdecho 0)
      (command "_.recover" "~")
      (while (/= 0 (logand (getvar 'cmdactive) 3))
        (command pause)
      )
      (setvar 'cmdecho 1)
      (princ)
    )[/code]

    Alternative:
    [code](defun c:Open ()
      (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "_.recover ")
      (princ)
    )[/code]
  •  Perfect, thanks ... 
This discussion has been closed.

Howdy, Stranger!

It looks like you're new here. Click one of the buttons on the top bar to get involved!