Good morning everyone,
I have a dwg I want to overwrite.
So by using code, I am saving the filename and path to an .ini file.
(defun SaveFileName (/ crntACADv crntFName crntFPath)
(prompt "\nSaving File Name ...")
(setq crntFName (getvar "dwgname") ; current file name
crntFPath (getvar "dwgprefix") ; current file path
crntFName (strcat crntFPath crntFName) ; put the two together
FNnote (open FNnotePath "W") ; write out to FixDWG_FN.ini
)
(write-line crntFName) ; "K:\\directory\\sub directory\\filename.dwg"
(setq FNnote (close FNnote))
(princ)
) ; _function SaveFileName
So, the .ini file has this
"K:\\2004-2005 EFM\\Yakima Firing Center\\PM5-YFC-E0002.dwg"
Then after a script is run opening a new template and running a LiSP, the LiSP calls the .ini and reads the line
(defun SaveDrawing (/ )
(setq FNnote (open FNnotePath "R")
NewFName (read-line FNnote)
...
The variable 'NewFName' is this
"\"K:\\\\2004-2005 EFM\\\\Yakima Firing Center\\\\PM5-YFC-E0002.dwg\""
Why does reading a line from a text file add quotes and backslashes throughout the string?
Do I need to go through this string character for character to clean it up or is there a better formatting way of doing this?
I really appeciate your help and could really use some ideas / code examples of how I could make this little thing work.
Thanks.