Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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.
Origami
Origami is the Japanese word for paper folding. ORI means to fold and KAMI means paper and involves the creation of paper forms usually entirely by folding.

Powered by VanillaForums, Designed by Steam