Could anyone assist me please.
I am not sure what I am doing wrong ?
Below is the first part of my routine and not all is relevant. I am stuck with the last part, trying to check if the file already exists to see if I need to replace the file "y" or not.
Code:
(setq drawprefix (getvar "dwgprefix"))
(setq drawname (getvar "dwgname"))
(setq bldlvl
(strcase (getstring "\nBuilding Level ie: B1, G, L1 or R? ")
)
)
(setq currentdirectory
(strcat (getvar "dwgprefix") (getvar "dwgname"))
)
(setq newdrawname (strcat "XR-A-" bldlvl))
(setq num 17)
(setq strlength (strlen drawprefix))
(setq newnum (- strlength num))
(setq ammenddrawprefix1
(strcat (vl-string-right-trim
(substr drawprefix newnum strlength)
drawprefix
)
"\\"
)
)
(setq newdirectpath (strcat ammenddrawprefix1 newdrawname))
(setq check (findfile newdrawname)
(if (= check newdirctpath) (command "saveas" "r14" newdirectpath "y") (command "saveas" "r14" newdirectpath))
[ Moderator Action = ON ] What are [ CODE ] tags... [ Moderator Action = OFF ]
Would be most great full.
Seems to work when the "If" options are (princ "\n...) rather the (command "saveas" ...)
Not sure, Should I be using the "cond" function ?
regards
stephen