TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Dave M on October 21, 2020, 01:23:10 PM

Title: Wondering if someone can take a look at this for me.
Post by: Dave M on October 21, 2020, 01:23:10 PM

I didn't write the attached file, but I was wondering if someone would take a look at it for me.  It works very well, but the instructions say to escape when finished selecting objects.  When you do that you get the following message:


"Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
Converting (command) calls to (command-s) is recommended."


I'm not sure if this is normal or an error.


Thanks

Title: Re: Wondering if someone can take a look at this for me.
Post by: JohnK on October 21, 2020, 01:41:36 PM
Shooting from the hip here:

Try replacing the "dmerro" function with the below (I just changed "command" to "command-s")
Code - Auto/Visual Lisp: [Select]
  1. (defun dmerror ()
  2.   (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
  3.     (princ (strcat "\nError: " errmsg))
  4.   ); end if
  5.   (command-s)
  6.   (if ucschanged (command-s "_.ucs" "_prev"))
  7.     ;; ^ don't go back unless routine reached UCS change but didn't change it back
  8.   (command-s "_.undo" "_end")
  9.   (dmreset)
  10. ); end defun
  11.  
Title: Re: Wondering if someone can take a look at this for me.
Post by: Dave M on October 21, 2020, 03:15:34 PM
Shooting from the hip here:

Try replacing the "dmerro" function with the below (I just changed "command" to "command-s")
Code - Auto/Visual Lisp: [Select]
  1. (defun dmerror ()
  2.   (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
  3.     (princ (strcat "\nError: " errmsg))
  4.   ); end if
  5.   (command-s)
  6.   (if ucschanged (command-s "_.ucs" "_prev"))
  7.     ;; ^ don't go back unless routine reached UCS change but didn't change it back
  8.   (command-s "_.undo" "_end")
  9.   (dmreset)
  10. ); end defun
  11.  


That did it! Thank you very much!
Title: Re: Wondering if someone can take a look at this for me.
Post by: JohnK on October 21, 2020, 04:04:31 PM
Not a problem. Glad I could help.
Title: Re: Wondering if someone can take a look at this for me.
Post by: BIGAL on October 21, 2020, 08:07:58 PM
The code refers to (dmpath) but there is no function in code so it could be amended to accept Enter as the exit method rather than the crash esc method.