Esc to exit causing problems

Discussion in 'AutoCAD' started by Dave M, Jan 27, 2005.

  1. Dave M

    Dave M Guest

    I have a small lisp routine that gets the current OSMODE, places multiple
    arcs, sets OSMODE back to current. When a user hits Esc to exit instead of
    Enter, the OSMODE variable does not get reset. Any help would be greatly
    appreciated. This is the Code I have.

    (setq OR_CURR (getvar "ORTHOMODE"))
    (setvar "ORTHOMODE" 0)
    (setq SN_CURR (getvar "SNAPMODE"))
    (setvar "SNAPMODE" 0)
    (setq OS_CURR (getvar "OSMODE"))
    (setvar "OSMODE" 530)

    (while (setq pt1 (getpoint "\nArc Start Point (enter to cancel): "))
    (setq pt2 (getpoint pt1 "\nEnd Point: "))
    (COMMAND "arc" PT1 "e" PT2 "d" PAUSE)
    )

    (setvar "ORTHOMODE" OR_CURR)
    (setvar "SNAPMODE" SN_CURR)
    (setvar "OSMODE" OS_CURR)
    (Princ)

    Thanks in advance.
    Dave
     
    Dave M, Jan 27, 2005
    #1
  2. Dave M

    Tom Smith Guest

    You need an error handller, that's what they're for.

    Search this NG on *error* -- it's been discussed in great detail.
     
    Tom Smith, Jan 27, 2005
    #2
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.