*error*

Two error-messages: one loading a LISP-file, one ending a LISP-file.
LOAD failed: "C:\\Data\\AutoCAD data\\Autolisp\\demo"; error: An error has
occurred inside the *error* functionAutoCAD variable setting rejected: "clayer" nil
AutoCAD variable setting rejected: "snapang" nil; error: An error has occurred inside the *error* functionAutoCAD variable setting rejected: "clayer" nil
What's going wrong here?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Ding Dong wrote:

well, is it something you wrote, and are therefore familiar with? "clayer" is a system variable, and can't be re-defun-ed in a lisp routine. it can be reset, but not redefined.
sim with snapang
I am lousy with error handlers, I write almost entirely without and only use the routines for ME. beta.
got a code snippet to submit for review? like maybe the offending piece(s)?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I'll bet the routine has calls to SETVAR to a variable, and the variable is not yet defined.
--


MichaelB
www.michaelbulatovich.ca
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Maybe you should post the code.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Here's the original code. It used to work without a glitch
; Routine voor het tekenen van loodrechte polylines ; geeft na <CR> een closed-polyline ; PTC/FKo
(defun *error* (wat) (princ "\n*error*: ") (princ wat) (terpri) (setq snapang_old (getvar "snapang")) (setvar "snapang" 0) (setvar "orthomode" 0) (setvar "cmdecho" 1) ) (defun c:perp(/ p p1 p2 p3 p4 p6) (setvar "cmdecho" 1) (setq p1 (getpoint "\nBeginpunt van de polyline") p2 (getpoint p1 "\nEindpunt van de eerste vertex") hoek (angle p1 p2)) (setvar "snapang" hoek) (setvar "orthomode" 1) (command "pline" p1 p2) (while (setq p (getpoint p2)) (command p) (setq p2 p) (if (= "")(setq p nil )) ) (command "u") (setq p3 (polar p1 (+ hoek (/ pi 2)) 10) p6 (polar p2 (+ hoek pi) 10) p4 (inters p1 p3 p2 p6 nil)) (command p4) (command "c") (setvar "snapang" snapang_old) (setvar "orthomode" 0) (setvar "cmdecho" 1) (princ) )
After moving the setq snapang_old and removing the error handling it works fine.
; Routine voor het tekenen van loodrechte polylines ; geeft na <CR> een closed-polyline ; PTC/FKo
(defun c:perp(/ p p1 p2 p3 p4 p6) (setq snapang_old (getvar "snapang")) (setq p1 (getpoint "\nBeginpunt van de polyline") p2 (getpoint p1 "\nEindpunt van de eerste vertex") hoek (angle p1 p2)) (setvar "snapang" hoek) (setvar "orthomode" 1) (command "pline" p1 p2) (while (setq p (getpoint p2)) (command p) (setq p2 p) (if (= "")(setq p nil )) ) (command "u") (setq p3 (polar p1 (+ hoek (/ pi 2)) 10) p6 (polar p2 (+ hoek pi) 10) p4 (inters p1 p3 p2 p6 nil)) (command p4) (command "c") (setvar "snapang" snapang_old) (setvar "orthomode" 0) (setvar "cmdecho" 1) (princ) )
It looks to me as if there's something wrong with AutoCAD's LISP-interpreter.
face=Arial size=2>...<BR></DIV></FONT> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV> <DIV><FONT face=Arial size=2>&gt;&gt; Two error-messages: one loading a LISP-file, one ending a LISP-file.<BR>&gt;&gt;<BR>&gt;&gt; LOAD failed: "C:\\Data\\AutoCAD data\\Autolisp\\demo"; error: An error has<BR>&gt;&gt; occurred inside the *error* functionAutoCAD variable setting rejected: <BR>&gt;&gt; "clayer"<BR>&gt;&gt; nil<BR>&gt;&gt;<BR>&gt;&gt; AutoCAD variable setting rejected: "snapang" nil; error: An error has <BR>&gt;&gt; occurred<BR>&gt;&gt; inside the *error* functionAutoCAD variable setting rejected: "clayer" nil<BR>&gt;&gt;<BR>&gt;&gt; What's going wrong here?<BR>&gt;&gt; <BR>&gt; <BR>&gt;</FONT></DIV></BODY></HTML>
------=
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
i'm corn-fused, if that's the original code, where is the "clayer" error?
face=Arial size=2>...<BR></DIV></FONT> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV> <DIV><FONT face=Arial size=2>&gt;&gt; Two error-messages: one loading a LISP-file, one ending a LISP-file.<BR>&gt;&gt;<BR>&gt;&gt; LOAD failed: "C:\\Data\\AutoCAD data\\Autolisp\\demo"; error: An error has<BR>&gt;&gt; occurred inside the *error* functionAutoCAD variable setting rejected: <BR>&gt;&gt; "clayer"<BR>&gt;&gt; nil<BR>&gt;&gt;<BR>&gt;&gt; AutoCAD variable setting rejected: "snapang" nil; error: An error has <BR>&gt;&gt; occurred<BR>&gt;&gt; inside the *error* functionAutoCAD variable setting rejected: "clayer" nil<BR>&gt;&gt;<BR>&gt;&gt; What's going wrong here?<BR>&gt;&gt; <BR>&gt; <BR>&gt;</FONT></DIV></BLOCKQUOTE></BODY></HTML>
------=
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Ditto on the clayer error. And I'm not sure about (setvar "snapang" hoek). Can anyone explain the hoek setting there?
"rod cohen comcast.net>" <i_doc<at> wrote in message face=Arial size=2>...<BR></DIV></FONT> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV> <DIV><FONT face=Arial size=2>&gt;&gt; Two error-messages: one loading a LISP-file, one ending a LISP-file.<BR>&gt;&gt;<BR>&gt;&gt; LOAD failed: "C:\\Data\\AutoCAD data\\Autolisp\\demo"; error: An error has<BR>&gt;&gt; occurred inside the *error* functionAutoCAD variable setting rejected: <BR>&gt;&gt; "clayer"<BR>&gt;&gt; nil<BR>&gt;&gt;<BR>&gt;&gt; AutoCAD variable setting rejected: "snapang" nil; error: An error has <BR>&gt;&gt; occurred<BR>&gt;&gt; inside the *error* functionAutoCAD variable setting rejected: "clayer" nil<BR>&gt;&gt;<BR>&gt;&gt; What's going wrong here?<BR>&gt;&gt; <BR>&gt; <BR>&gt;</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
------=
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
About 10 years ago I wrote this routine for easy digitizing maps with various buildings on it. It enables perpendicular angles in any direction and it closes the polyline with a last perpendicular line.
The point is that AutoCAD tells An error has occurred inside the *error* function. How come? Is AutoCAD drunk :? Apparently not, after one day of rest the original file still doesn't work. :( But then again, what is wrong with the *error* handling and how can I get it right (without having to re-install AutoCAD)? I'm now working with 2007, but I recall the fault when working with R14. Especially the AutoCAD variable setting rejected: "clayer" nil. happened in routines where clayer was not used...
face=Arial color=#008080 size=2>...<BR><BR><BR>&nbsp;&nbsp;&nbsp; &gt;&gt; Two error-messages: one loading a LISP-file, one ending a LISP-file.<BR>&nbsp;&nbsp;&nbsp; &gt;&gt;<BR>&nbsp;&nbsp;&nbsp; &gt;&gt; LOAD failed: "C:\\Data\\AutoCAD data\\Autolisp\\demo"; error: An error has<BR>&nbsp;&nbsp;&nbsp; &gt;&gt; occurred inside the *error* functionAutoCAD variable setting rejected: <BR>&nbsp;&nbsp;&nbsp; &gt;&gt; "clayer"<BR>&nbsp;&nbsp;&nbsp; &gt;&gt; nil<BR>&nbsp;&nbsp;&nbsp; &gt;&gt;<BR>&nbsp;&nbsp;&nbsp; &gt;&gt; AutoCAD variable setting rejected: "snapang" nil; error: An error has <BR>&nbsp;&nbsp;&nbsp; &gt;&gt; occurred<BR>&nbsp;&nbsp;&nbsp; &gt;&gt; inside the *error* functionAutoCAD variable setting rejected: "clayer" nil<BR>&nbsp;&nbsp;&nbsp; &gt;&gt;<BR>&nbsp;&nbsp;&nbsp; &gt;&gt; What's going wrong here?<BR>&nbsp;&nbsp;&nbsp; &gt;&gt; <BR>&nbsp;&nbsp;&nbsp; &gt; <BR>&nbsp;&nbsp;&nbsp; &gt;</FONT></BODY></HTML>
------=
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
This is a multi-part message in MIME format. --------------080006040108010908000105 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit
Ding Dong wrote:

I am on an old version of Autocad. this is just a hunch.
type (terpri) at the command line and see if 07 interprets it correctly. if there is an abondonded piece of code, that looks suspicious to me.
otherwise I would load VLISP and run the code line by line til it fails.
--------------080006040108010908000105 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> <font face="Arial">Ding Dong wrote:</font> <blockquote cite="mid45d24258$0$751$ snipped-for-privacy@dreader2.news.tiscali.nl" type="cite"> <pre wrap=""><font face="Arial">Two error-messages: one loading a LISP-file, one ending a LISP-file.
LOAD failed: "C:\\Data\\AutoCAD data\\Autolisp\\demo"; error: An error has occurred inside the *error* functionAutoCAD variable setting rejected: "clayer" nil
AutoCAD variable setting rejected: "snapang" nil; error: An error has occurred inside the *error* functionAutoCAD variable setting rejected: "clayer" nil
What's going wrong here?
</font></pre> </blockquote> I am on an old version of Autocad. this is just a hunch.<br> <br> type <font color="#3333ff">(terpri)</font> at the command line and see if 07 interprets it correctly.<br> if there is an abondonded piece of code, that looks suspicious to me.<br> <br> otherwise I would load VLISP and run the code line by line til it fails.<br> <br> <br> </body> </html>
--------------080006040108010908000105--
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.