dungcan68 Posted April 1 Posted April 1 (edited) ;;*************************************************** ;; ÐO GÓC 3D free lisp from cadviet.com (defun c:GH (/ p1 p2 p3 v1 v2 angrad angdeg) (setq p1 (getpoint "\nPick point common to both lines.") p2 (getpoint p1 "\nPick end of first line.") p3 (getpoint p1 "\nPick end of second line.") v1 (uvec (mapcar '- p2 p1)) v2 (uvec (mapcar '- p3 p1)) angrad (@acos (dot v1 v2)) angdeg (/ (* angrad 180.) 3.14159265359) ) (princ "\nAngle between the two lines (degrees): ") (princ angdeg) (princ) ) Error when running: Cannot invoke (command) from *error* without prior call to (*push-error-using-command*). Converting (command) calls to (command-s) is recommended. Please help me fix this error. Only when used on autocad 2021 does it happen. Thank you 123.lsp Edited April 1 by SLW210 Added CodeTags! Quote
SLW210 Posted April 1 Posted April 1 Please use Code Tags in the future. (use the <> in the editor toolbar) Quote
dungcan68 Posted April 1 Author Posted April 1 2 hours ago, SLW210 said: 2 hours ago, SLW210 said: Please use Code Tags in the future. (use the <> in the editor toolbar) Sorry to bother everyone. The error occurred because I copied the missing lisp Quote
pkenewell Posted April 1 Posted April 1 9 hours ago, dungcan68 said: Error when running: Cannot invoke (command) from *error* without prior call to (*push-error-using-command*). Converting (command) calls to (command-s) is recommended. Please help me fix this error. Only when used on autocad 2021 does it happen. Thank you @dungcan68 The error you are describing could not be coming from the code you have presented, but rather an global error handler made by some other additional code not included in what you have shown. The error itself comes from using the (command) function within an error handler, which causes some issues in newer versions of AutoCAD. the (command-s) function was created to allow command functions from within an error handler when referencing local variables, but older code that was not upgraded may display this error. I recommend you start looking through other AutoLISP functions you have loaded to determine which code is using a global error handler that contains the (command) function. See the following link for more info: https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-5C9DC003-3DD2-4770-95E7-7E19A4EE19A1 1 Quote
Steven P Posted April 1 Posted April 1 As pkenewell, I think the issue is in the other LISPs, one of these: uvec @acos dot Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.