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
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
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* (....
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
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.
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
@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.
I attached the TTXT.sub file. I had to switch it to a TXT file to upload to sight.
Thanks
Kurt Weber
@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.
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.