Author Topic: Wondering if someone can take a look at this for me.  (Read 2563 times)

0 Members and 1 Guest are viewing this topic.

Dave M

  • Newt
  • Posts: 196
Wondering if someone can take a look at this for me.
« 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

Civil 3D 2018 - Microstation SS4 - Windows 10 - Dropbox

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Wondering if someone can take a look at this for me.
« Reply #1 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.  
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Dave M

  • Newt
  • Posts: 196
Re: Wondering if someone can take a look at this for me.
« Reply #2 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!
Civil 3D 2018 - Microstation SS4 - Windows 10 - Dropbox

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Wondering if someone can take a look at this for me.
« Reply #3 on: October 21, 2020, 04:04:31 PM »
Not a problem. Glad I could help.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

BIGAL

  • Swamp Rat
  • Posts: 1398
  • 40 + years of using Autocad
Re: Wondering if someone can take a look at this for me.
« Reply #4 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.
A man who never made a mistake never made anything