Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Command-s

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
kurt-w
21925 Views, 8 Replies

Command-s

I recently installed Autocad 2017 and can not get some of my lisps to work. It seems to be the ones that involve text and picking more then one point. It gives the error below.

 

Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
Converting (command) calls to (command-s) is recommended.Enter list of object snap modes: *Cancel*

 

Is there something I'm missing because i have tried to change command to command-s with no results. Let me know what you think.

 

Thanks

Kurt Weber

 

 

8 REPLIES 8
Message 2 of 9
Kent1Cooper
in reply to: kurt-w

The change of (command) to (command-s) would be needed only in the *error* handler.  The message is because some error is occurring that triggers the *error* handler, which in newer versions has that restriction.

 

You can eliminate that problem by resetting the Layer not by using a (command) function, but by setting the system variable.  Replace:

 

(command "layer" "s" curlay "")

 

with

 

(setvar 'clayer curlay)

 

and that error message will not appear.  [I would do it in both places, but you really need to only in the *error* handler.]

 

BUT that won't stop the error that is triggering the *error* handler and thereby that message -- there will probably still be some error within the (TTXT) function, which you have not supplied.  Post that, and maybe we can figure out what's not working about it.

 

And by the way, you really should define *error* inside the command definition, and list it as a localized "variable" so that it will go away and revert to AutoCAD's basic error handler when the command is done:

 

(DEFUN C:T6 (/ *error* ....

  (defun *error* (....

Kent Cooper, AIA
Message 3 of 9
kurt-w
in reply to: Kent1Cooper

This is the error that comes up now. This error pops up after I pick the first point and try to pick the second point.

 

Pick a POINT on one side of duct - NEAR TEXT:
Invalid object snap modes.
error:Function cancelledEnter list of object snap modes: *Cancel*

 

Thanks

Kurt

 

 

Message 4 of 9
Kent1Cooper
in reply to: kurt-w

What you posted only loads and runs a (TTXT) function.  That error must be internal to TTXT, so we would need to see the code for that.

Kent Cooper, AIA
Message 5 of 9
kurt-w
in reply to: Kent1Cooper

I attached these below. If I remember right everything is pulling from BAETEMACS and BAETEHVAC. Is this what you are looking for?

 

 

Thanks

Kurt Weber

Message 6 of 9
Kent1Cooper
in reply to: kurt-w


@kurt-w wrote:

I attached these below..... Is this what you are looking for?

 

....

No.  The T6 routine includes this:

....

(load_sub "TTXT")
(TTXT)

....

And via the (load_sub) routine [which is in ACAD.lsp] would apparently thereby load, and then run, a file called TTXT.sub.  I was expecting it would be TTXT.lsp, but if a .sub file is the same kind of thing, that's what we would need to see, because the asking-for-points operation that's giving you trouble has to be inside that.

Kent Cooper, AIA
Message 7 of 9
kurt-w
in reply to: Kent1Cooper

I attached the TTXT.sub file. I had to switch it to a TXT file to upload to sight.

 

Thanks

Kurt Weber

Message 8 of 9
Kent1Cooper
in reply to: kurt-w


@kurt-w wrote:

I attached the TTXT.sub file. ....


It could be the same issue as in this recent thread -- that the "quick" Osnap mode has gone away.  Try changing "quick,per" to just "per" and see whether it works.  If not, we can dig deeper to look for whatever else may be causing the problem.

Kent Cooper, AIA
Message 9 of 9
kurt-w
in reply to: Kent1Cooper

Removing the word quick from all of our subs fixed our problem.

 

Thanks

Kurt Weber

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report