*Cancel* at command line?

Discussion in 'AutoCAD' started by GaryDF, Sep 9, 2004.

  1. GaryDF

    GaryDF Guest

    I tested my setup at home.
    (1) no added startup
    (2) only acad menu loaded
    (3) no acad.lsp file
    (4) no added customization

    Problem is all commands from the acad menu pulldowns have *cancel* *cancel*
    showing up twice at the command line. All typed in commands at the command line
    are fine and do not have the *cancel*


    I am not running any lisp routine...no custom startup functions....so where are
    the *cancels* coming from?


    Gary
     
    GaryDF, Sep 9, 2004
    #1
  2. GaryDF

    Jeff Mishler Guest

    Most toolbar/pulldown menu items start with ^C^C which is
    *Cancel**Cancel*......to suppress them, set the sytem variable "MENUECHO" to
    1
     
    Jeff Mishler, Sep 9, 2004
    #2
  3. GaryDF

    GaryDF Guest

    Type: Integer
    Not saved
    Initial value: 0

    Sets menu echo and prompt control bits. The value is the sum of the following:

    1 Suppresses echo of menu items (^P in a menu item toggles echoing)

    2 Suppresses display of system prompts during menu

    4 Disables ^P toggle of menu echoing

    8 Displays input/output strings; debugging aid for DIESEL macros



    So setting it to zero I should get *cancel* when using the acad pulldwwn menu
    commands?
    I am running autocad out of the box (so to speak), if this setvar is not saved,
    where and why
    should I save it.

    Gary
     
    GaryDF, Sep 9, 2004
    #3
  4. GaryDF

    Joe Burke Guest

    Gary,

    Sounds like the QAFLAGS variable is set to something other than zero.

    Joe Burke
     
    Joe Burke, Sep 9, 2004
    #4
  5. GaryDF

    GaryDF Guest

    I have autocad 2002, 2004 and 2005 on the same computer at home as well as the
    office.
    I am only experencing this problem at home............

    I have gone back and reset to the default setting for the profiles.
    I unloaded all my customized setups and routines and went back to vanilla
    autocad.

    All three versions are experences the same problem with the double *cancel*, but
    only for the commands thru the pulldown menu....typed in commands are not
    effected.

    Please explain about the QAFLAGS variable, becaus I know its not the MENUECHO
    variable.

    Thanks

    [_]P

    Gary
     
    GaryDF, Sep 10, 2004
    #5
  6. GaryDF

    GaryDF Guest

    Thanks Joe, this fixed the problem. I have never had this happen to me
    before...and how did
    it effect all three versions? I have some homework to do on my customization
    routines.

    Thanks again, this had me stumped


    )))))))
    (o)-(o)
    -----oo0---(_)---0oo--------------------------
    | | | | | | | | | | | |
    | | | | | | | | | | | |

    Gary
     
    GaryDF, Sep 10, 2004
    #6
  7. GaryDF

    Joe Burke Guest

    Hi Gary,

    I don't know about the details regarding why the QAFLAGS setting affected all three
    versions. It's an old undocumented variable. Check this
    http://www.manusoft.com/Resources/AcadExposed/index.stm for more info.

    Regarding your homework, look for programs which attempt to explode a selection set
    of blocks. Setting QAFAGS to 1 allows that operation. Of course, without a proper
    error handler, canceling such a program would leave QAFLAGS set to 1. Resulting in
    this when you call a command from a standard menu.

    Command: *Cancel*
    Command: *Cancel*

    Glad I could help.
    Joe Burke
     
    Joe Burke, Sep 10, 2004
    #7
  8. GaryDF

    GaryDF Guest

    QAFLAGS bitcode 0 - 32767* R11 bit 0 (1) : ^C in menu macro cancels grips
    (acts like keyboard <Esc>).
    bit 1 (2) : no pause during text screen listings.
    bit 2 (4) : no "alert" dialogs (text display instead).
    bit 7 (128) : accepts "screen picks" (point lists) via (command) function.
    *Note that this was an integer with range -32768 - 32767 in R11, then it
    changed to 0 - 32767 in R12.[2]



    here is my error handler:

    (defun ARCH:ERROR (varlist)
    (vl-load-com)
    ;;Defines var-set function list.
    (defun-q var-set
    ()
    (command "._Undo" "_e")
    (command "._U")
    (princ)
    )
    ;;Adds expression lists of variables to be reset.
    (defun-q-list-set
    'var-set
    (append '((/))
    '((command "._Undo" "_e"))
    '((command "._U"))
    (mapcar
    (function (lambda (var) (list 'setvar var (getvar var))))
    varlist
    )
    (cdddr (defun-q-list-ref 'var-set))
    )
    )
    ;;Allows adding command expressions to var-set.
    (defun add-cmd (cmd)
    (if (not (vl-position cmd var-set))
    (defun-q-list-set
    'var-set
    (append '((/))
    '((command "._Undo" "_e"))
    '((command "._U"))
    (list cmd)
    (cdddr (defun-q-list-ref 'var-set))
    )
    )
    )
    )
    ;;Removes command expressions from var-set.
    (defun del-cmd (cmd)
    (defun-q-list-set 'var-set (vl-remove cmd var-set))
    )
    ;;Exits clean, quiet, & resets vars. Removes undo from var-set.
    (defun ARCH:F_CLEAN ()
    (del-cmd (list 'command "._U"))
    (var-set)
    (if (/= arch_dms nil)
    (progn (setvar "cmdecho" 0)
    (command "dimstyle" "r" arch_dms)
    (graphscr)
    )
    )
    )
    (add-cmd (list 'setvar "cmdecho" (getvar "cmdecho")))
    (setvar "cmdecho" 0)
    (command "._Undo" "_be")
    ;;Redefine standard *error*. Make sure *error* is declared
    ;;as a local variable in the main routine.
    (defun *error* (msg)
    (setvar "cmdecho" 0)
    (if (not (vl-position
    msg
    '("*Cancel*"
    "console break"
    "Function cancelled"
    "quit / exit abort"
    )
    )
    )
    (princ (strcat "\nError: " msg))
    )
    (while (= 1 (logand (getvar "cmdactive") 1))
    (command)
    )
    (var-set)
    (if msg
    (princ
    "\n\n*** ///////// Program CANCELLED ///////// ***\n"
    )
    )
    )
    )

    (defun ARCH:F_S-VAR ()
    (ARCH:ERROR
    '("APERTURE" "ATTDIA" "ATTREQ" "BLIPMODE"
    "CECOLOR" "CLAYER" "CELTYPE" "CMDECHO"
    "DIMSCALE" "DRAGMODE" "EXPERT" "FILEDIA"
    "FILLETRAD" "GRIDMODE" "HIGHLIGHT" "LUNITS"
    "MENUECHO" "MIRRTEXT" "OFFSETDIST" "ORTHOMODE"
    "OSMODE" "PICKBOX" "PLINEWID" "REGENMODE"
    "SNAPMODE"
    ;;"SNAPUNIT"
    ;;"SNAPBASE"
    "SNAPANG" "SNAPSTYL" "TEXTEVAL"
    ;;"TEXTSTYLE"
    )
    )
    (setq arch_dms (getvar "dimstyle"))
    (princ)
    )

    (defun ARCH:F_R-VAR (/ *error*)
    (ARCH:F_CLEAN)
    (setq op nil
    sset nil
    )
    (if SSET
    (command "change" SSET "" "p" "c" "bylayer" "")
    )
    ;;(*Error* nil)
    (princ)
    )



    So should my error handler always set QAFLAGS to zero?
    Thanks again.

    Gary
     
    GaryDF, Sep 10, 2004
    #8
  9. GaryDF

    Joe Burke Guest

    Gary,

    I think the solution depends on the source of the problem. Were you able to determine
    what caused the setting change? And a related question, do you ever use that variable
    in your code? Personally, I avoid it.

    Joe Burke
     
    Joe Burke, Sep 11, 2004
    #9
  10. GaryDF

    GaryDF Guest

    I have not found it yet.

    I add this to my startup as a temporary fix:
    (setvar "qaflags" 0) ;reset to default value


    Gary
     
    GaryDF, Sep 13, 2004
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.