Error message

Error message

sam_safinia
Advocate Advocate
694 Views
9 Replies
Message 1 of 10

Error message

sam_safinia
Advocate
Advocate

What is thi error message for?

 

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

 

Thanks

0 Likes
695 Views
9 Replies
Replies (9)
Message 2 of 10

Ajilal.Vijayan
Advisor
Advisor

Hi,

Can you give more details(AutoCAD version, Product) regarding when this error message shown ?

If you are running any lisp routine have you tried replacing the command to command-s as suggested in the error message ?

More about this error

0 Likes
Message 3 of 10

sam_safinia
Advocate
Advocate
You are right. It appears after running lisp. I got this in ver. 2015 & 16.
0 Likes
Message 4 of 10

Ajilal.Vijayan
Advisor
Advisor

Try after replacing command to command-s, or post the code here to check.

0 Likes
Message 5 of 10

Kent1Cooper
Consultant
Consultant

@Ajilal.Vijayan wrote:

Try after replacing command to command-s....


... but perhaps only (command) functions inside the *error* handler [typically used for Undo End but also possibly things like UCS resetting, etc.].  Read about (command-s) in Help, where the differences between it and (command) are described, as well as certain restrictions -- you can't simply replace all (command) functions with (command-s) functions.

Kent Cooper, AIA
0 Likes
Message 6 of 10

carlos_m_gil_p
Advocate
Advocate

Replace

 

command by command-s
vl-cmdf by command-s

 

So I fix myself.

 

I hope it helps you.

A greeting.


AutoCAD 2026.1.1
Visual Studio Code 1.105.1
AutoCAD AutoLISP Extension 1.6.3
Windows 10 - 22H2 (64 bits)

0 Likes
Message 7 of 10

sam_safinia
Advocate
Advocate
Actually replacing command-s didn't help. I am just curious regarding
version of CAD hat this lisp is written for which is quite old.It might be
version 12 or 13.

After running the routine the DCL appears and everything looks OK but when
start to invoke the lisp I get this error:

"ERR_CTRL version 1.4 loaded.

>From point:

To point:

Cannot invoke (command) from *error* without prior call to
(*push-error-using-command*).

Converting (command) calls to (command-s) is recommended."

The lisp is reading a config file and error control routine. I found this
code in error control lisp:

.....

; Start an undo group so *error* can undo everthing that occured before
it was called.

; In R12 the command was Group, in R13 it was changed to Begin.

(if (< (atoi (getvar "ACADVER")) 13)

(command "_.UNDO" "_G")

(command "_.UNDO" "_BE")

) ;if

.....

Thanks
0 Likes
Message 8 of 10

Kent1Cooper
Consultant
Consultant

@s_plant wrote:
... when start to invoke the lisp I get this error:

"ERR_CTRL version 1.4 loaded.

>From point:

To point:

Cannot invoke (command) from *error* ....
....
(command "_.UNDO" "_G")
(command "_.UNDO" "_BE")
....

There appears to be more wrong than just the (command)-in-*error* problem, if you're getting that message upon giving a point....  But in any case:

 

There should be something in your error handler that is similar to those Undo-related commands but with the End option, and that is where you should change function names from (command ...) to (command-s ...).  HOWEVER, if you are also running any computers with AutoCAD older than [I think] 2015, they won't recognize (command-s) as a function.  If you have AutoLisp routines with *error* handlers that need to run on both older and newer versions of AutoCAD, you may need to switch to (vla) methods of starting and ending the Undo wrapping, avoiding either (command) or (command-s).  Write back if that's what you need to do, or Search for

 

(vla-startundomark

 

to find examples of code that does it that way.

Kent Cooper, AIA
0 Likes
Message 9 of 10

sam_safinia
Advocate
Advocate

Thanks guys but still cannot run my lisp. I try on my end again and again...

0 Likes
Message 10 of 10

hmsilva
Mentor
Mentor

@s_plant wrote:

Thanks guys but still cannot run my lisp. I try on my end again and again...


Hi s_plant,

would be easier to help, if you show us your code...

 

Henrique

EESignature

0 Likes