Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
FT398
Posts: 94
Registered: ‎03-09-2003
Message 11 of 14 (184 Views)

Re: Reactor triggers fatal error

06-18-2012 07:34 AM in reply to: FT398

Found it.

 

It seems that the error is triggered by the use of command-s within the routines error handlers.

 

A search tells me that command-s appears in these files so presumably they will all be affected.

 

MVSETUP.lsp

EDGE.lsp

AI_UTILS.lsp

VL.arx

Distinguished Mentor
Moshe-A
Posts: 784
Registered: ‎09-14-2003
Message 12 of 14 (166 Views)

Re: Reactor triggers fatal error

06-18-2012 10:01 PM in reply to: FT398

Hi,

 

You mean they use (command) function?

i do not thing they made so essential changes to these command from previous releases

 

moshe

Valued Contributor
FT398
Posts: 94
Registered: ‎03-09-2003
Message 13 of 14 (162 Views)

Re: Reactor triggers fatal error

06-18-2012 10:33 PM in reply to: FT398

It seems that command-s was introduced in AutoCAD 2012. The MVSETUP and EDGE lisp routines which shipped with 2011 and earlier use 'command' and these versions do not trigger the fatal error. However, the use of command-s on 2012 and 2103 when a CommandWillStart reactor is loaded will trigger a fatal error.

 

Partial  error routine from Edge.lsp (2011)

 

(defun edge-er (n) 
  (if (/= s "Function cancelled") 
    (princ (strcat "\nError: " n))
  ) 
  (command) 
  (command "_.UCS" "_P")

 

Same section from Edge.lsp (2013)

 

(defun edge-er (n) 
  (setq *error* lisp-er)
  (if (/= s "Function cancelled") 
    (princ (strcat "\nError: " n))
  ) 
  (edge_setCmdEcho 0)
  (command-s "_.UCS" "_P") 

 

 

If you are running 2012/2013 then load the reactor from my original post and then use this command and you will get a fatal error:

 

(command-s "_.line" "0,0,0" "10,10,0" "")

Valued Mentor
Ian_Bryant
Posts: 362
Registered: ‎06-02-2005
Message 14 of 14 (145 Views)

Re: Reactor triggers fatal error

06-19-2012 04:41 AM in reply to: FT398
Yes you are right, using the command-s function causes Autocad to crash,
when a command reactor is loaded.
I eventually found a description of this function in 2013 help.
It says that the function runs in a temporary command processor
separate from the main Autocad command processor,
and gives an example of how improper use might crash Autocad.
- using (command-s "U") while an ordinary command is active.
It would appear that they forgot to consider how the function
would handle command reactors.
Ian
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!