command line instead of settings dialog boxes

Sometimes during a drawing session the settings dialog boxes for layers or blocks, etc. stop coming up.

Instead I get the command line version.

I think it must be a system variable my lisps are resetting, but I can't find it.

If I close the session and reopen, the dialog boxes are restored.

Comments

  • My first guess was CMDDIA but my quick test did not seem to affect those commands.

  • That was my first guess, too.

    No, I suspect some kind of bug when some particular lisp of mine bombs, or I cancel in the middle.

    Difficult to narrow it down, though.

    I doubt it's a system variable, because then why would it self-correct when I reopen the file?

    I hoped somebody had an idea.

     

  • Many of my Lisp routines change various sysvars during the execution of the program according to the need. I have a routine at the beginning of every file that stores the values of all commonly changed sysvars and a routine at the end of the file that restores all of these sysvars to their original setting. If a program crashes or, forbid, if I cancel a program before it finishes, all of the changed variables are in their changed setting and must be manually restored... or restored with a routine that restores these variables to their settings at the time the drawing was opened. Sounds like this may be the case here.

  • You should reset sysvariables in an error handler in each lisp.

    inside your lisp define an error handler:

    (defun c:yourlisp ()
    (defun %error ( *s / *s )
    (if (and (/= *s "Function cancelled")
    (/= *s "quit/exit abort")
    )
    (princ (strcat "\nError: " *s))
    )
    (setq *error* %olderror)
    (command "ucs" "p") ;reset sysvariables and whatever cleanup you need if the lisp is cancelled or bombs
    (if (and @icad @ucs)(setvar "TILEMODE" 1))
    (setvar "CMDECHO" 1)
    (command "undo" "end")
    (setq *error* %olderror %error nil) ;including restoring the originsl error handler
    )
    ) ;enable the error handler:
    (setq %olderror *error*
    *error* %error
    )

    ;;;;;your lisp;;;;

    (setq *error* %olderror %error nil) ;; restore the original error handler
    )

    I sometimes (okay, often) don't do this.

    Maybe it's time to clean up my code :)

This discussion has been closed.