LISP program not working in 2010 but worked in 2006.

LISP program not working in 2010 but worked in 2006.

Anonymous
Not applicable
627 Views
6 Replies
Message 1 of 7

LISP program not working in 2010 but worked in 2006.

Anonymous
Not applicable

Hello, I am not a LISP expert by any means. The attached LISP program runs in AUTO CAD 2006 but not in later versions, we upgraded to 2010. Any input would be greatly appreciated, or if someone would take a look and see if they could identify the problem.

 

Thank you,

 

Scott in WI

0 Likes
628 Views
6 Replies
Replies (6)
Message 2 of 7

hmsilva
Mentor
Mentor

@Anonymous wrote:

Hello, I am not a LISP expert by any means. The attached LISP program runs in AUTO CAD 2006 but not in later versions, we upgraded to 2010. Any input would be greatly appreciated, or if someone would take a look and see if they could identify the problem.

 

Thank you,

 

Scott in WI


Hi Scott,

in a quick read, what I would suggest to start debugging your code is:

The code uses T as a variable, channge all T instaces to T1, or something else (inside 'SHAPE' function), T is a built-in symbol and seting T as a variable you are redefining it.

 

After that, try your code, and if it does not work as expected, share with us the error message or what did not happen and it was supposed to happen and a sample dwg.

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 3 of 7

Kent1Cooper
Consultant
Consultant

@hmsilva wrote:


....

The code uses T as a variable, channge all T instaces to T1, or something else (inside 'SHAPE' function), T is a built-in symbol and seting T as a variable you are redefining it.

....


[Absolutely they should do that, but if that were the main issue, wouldn't they have had problems even in earlier versions?]

Kent Cooper, AIA
0 Likes
Message 4 of 7

hmsilva
Mentor
Mentor

@Kent1Cooper wrote:

@hmsilva wrote:


....

The code uses T as a variable, channge all T instaces to T1, or something else (inside 'SHAPE' function), T is a built-in symbol and seting T as a variable you are redefining it.

....


[Absolutely they should do that, but if that were the main issue, wouldn't they have had problems even in earlier versions?]


I'm not saying that redefining 'T' is the main issue... It's a start...

in a quick read, I have not seen any version related issue...

 

Henrique

EESignature

0 Likes
Message 5 of 7

Anonymous
Not applicable

I changed the T to T1 and it didn't make a difference.

This is what is happening when it runs. I can get to the point where I enter notes. I can put anything on this line and I always get,  

 

; error: bad argument type: FILE nil

Command: Command:

 

Any Ideas, this does work on a different computer running 2006.

0 Likes
Message 6 of 7

hmsilva
Mentor
Mentor

@Anonymous wrote:

I changed the T to T1 and it didn't make a difference.

This is what is happening when it runs. I can get to the point where I enter notes. I can put anything on this line and I always get,  

 

; error: bad argument type: FILE nil

Command: Command:

 

Any Ideas, this does work on a different computer running 2006.


To debug, load your code in VLIDE, in debug menu -> Break On Error

Open the code in VLIDE

debug menu -> Break On Error

load your code

run the code,

when error Ctrl + F9 will display the code line with error...

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 7 of 7

marko_ribar
Advisor
Advisor

At first glance when looked into error message you posted, try adding this marked red...

 

(defun FILER (/ fn CMD)
 (COMMAND "REDRAW")
 (setq #fnam (if #fnam #fnam (strcat (getvar "dwgprefix") (getvar "dwgname") ".350")))
 (setq fn (getstring (strcat "\nFile <" #fnam ">: ")))
 (if (/= fn "")(setq #fnam fn))
 (if
  (findfile #fnam) 
   (progn
    (initget "A O")
    (setq CMD (getkword "\nFile exists...Append/Overwrite <A>:"))
    (if (= CMD "O") (setq CMDS "w") (setq CMDS "a"))
   )
   (setq CMDS "w")
 )
 (setq #opn (open #fnam CMDS))
 (princ
  (strcat "\n" #fnam " opened for "    
                      (if (= CMDS "w")
                        "writing"
                        "appending") " to."))
) ;end filer

But then again, I don't know why it worked fine in previous versions... (A2006)

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes