Jump to content

Error Trapper Failing...


lamensterms

Recommended Posts

Hey guys,

 

I'm just having a few issues with an error trapper in a MIRROR LISP routine I have. Just wondering if someone wouldn't mind taking a quick look.

 

The error trapper works OK for an ESC at most steps through the routine, but it seems to fail after the line I have highlighted bold/blue in the code below:

 

(defun err (s)
(command "u")
(prompt "\n*Program Terminated*")
(setq *error* exi)
(princ)
)

(defun c:mi ( / MIss MIpt1 MIpt2 OROS)
(SETQ OROS (GETVAR "OSMODE"))
(SETQ ORORT (GETVAR "ORTHOMODE"))
(COMMAND "undo" "BE")
(SETVAR "OSMODE" 0)
(SETVAR "ORTHOMODE" 1)
(SETVAR "cmdecho" 0)
(COMMAND "undo" "END")
(setq exi *error*)
(setq *error* err)
(setq MIss (ssget))
(setq MIpt1 (getpoint))
(command "ucs" "O" MIpt1)
[b] [color="blue"](setq MIpt2 '( 0 0 0))[/color][/b]
(command "mirror" MIss "" MIPT2 pause pause)
(command "ucs" "P")
(SETVAR "OSMODE" OROS)
(SETVAR "ORTHOMODE" ORORT)
(SETVAR "cmdecho" 0)
(princ)
)

 

If I hit ESC anytime after the line in blue... the error trapper doesn't seem to activate.

 

I haven't really had much experience with error handling in the past. To be honest, I've had some bad experiences with UNDO>MARK/BACK resulting in everything in the session being undone, and have been scarred off (UNDO>BACK frightens me, haha).

 

Looking forward to hearing back.

 

Thanks for any help.

Edited by lamensterms
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...