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

variable in lisp keeps reading/ putting ou the value as being "ÿþa"??

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
The_Caddie
404 Views, 4 Replies

variable in lisp keeps reading/ putting ou the value as being "ÿþa"??

dose anybody know why my variable keeps on putting out the symbols "ÿþa" instead of the select ctb.

 

heres my code:

 

(setq f (open "C:\\ICT\\AutoCAD_Architecture_Suite_2012\\CUSTOM\\TREADSTONE\\PEN\\MYPLOTSTYLE.PEN" "r"))
(setq MYPLOTSTYLE (read-line f))
(close f)

(Command "-Plot" "Y" MYLAYOUT MYOUTPUTDEVICE MYPAPERSIZE "Millimeters" MYPAPERORIENTATION "No" "layout" "Fit" "0.00,0.00" "YES" MYPLOTSTYLE "No" "No" "Yes" "No" "No" "No" "yes")

 

4 REPLIES 4
Message 2 of 5
Kent1Cooper
in reply to: The_Caddie


@The_Caddie wrote:

dose anybody know why my variable keeps on putting out the symbols "ÿþa" instead of the select ctb.

 

heres my code:

 

(setq f (open "C:\\....\\MYPLOTSTYLE.PEN" "r"))
(setq MYPLOTSTYLE (read-line f))
(close f)

(Command "-Plot" ... "YES" MYPLOTSTYLE ...)

 


Maybe this is too obvious a question, but I guess I have to ask:  Is the MYPLOTSTYLE.PEN file a plain text file, and is the .ctb file name the first line in it?

Kent Cooper, AIA
Message 3 of 5
The_Caddie
in reply to: Kent1Cooper

yes the infamous pen file your quite right Kent though I'll add the ctb file name is the only thing in the pen/ text file...

 

Im also thinking its the fact i have a period in my file name which is giving the variable a headache?

Message 4 of 5
Kent1Cooper
in reply to: The_Caddie


@The_Caddie wrote:

yes the infamous pen file your quite right Kent though I'll add the ctb file name is the only thing in the pen/ text file...

 

Im also thinking its the fact i have a period in my file name which is giving the variable a headache?


It may be the only thing there, but if the file is something like a word processor document file, or a spreadsheet, or who knows what else, rather than a plain text file, there could easily be other coding elements in the file [font and size designators, etc.], preceding the content you actually see when you open the file.

 

If it does come from some other kind of program, you could try opening it in a plain-text editor like Notepad if you can, and saving it there, to eliminate any such elements -- it will probably warn you about losing encoding.  But that assumes you don't also need the file in whatever its original form is, for some other purpose.

 

Or you could try a (while) loop, repeating (read-line) until what it returns is just a text string ending in ".ctb", assuming that it will do that eventually [it might not, depending on how lines in the file are broken down].

 

I doubt the period is the problem, if it's just the separator between the file name and the file type -- the (open) function deals with those all the time.

Kent Cooper, AIA
Message 5 of 5
The_Caddie
in reply to: Kent1Cooper

nope its just a text file with just an extention type change i made up the text inside is compiled by a vb.net program though as you can see the other variables are working okay and they use the exact same method i have hoever taken the time to delete the file and re-make the whole thing by hand ussing plain old notepad howver the resulat remained the same?

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

Post to forums  

Autodesk Design & Make Report

”Boost