maybe its a problem, if the file already exists
you could
(vl-file-delete filenam)
i guess it doesn´t crash, if the file does not exist
and the filenam should be
(setq FILENAM (strcat (getvar "DWGPREFIX") (vl-filename-base (getvar
"DWGNAME"))))
andrew.nao wrote:
> Hello folks,
> hoping someone might have a solution for this that maybe im not seeing.
> this lisp code is supposed to write a dwg to a pdf in the same directory as
> the dwg
> sometimes it works sometimes it doesn't, more doesn't then does.
>
> does anyone see why it wouldn't save to the same directory as the dwg
> any help is appreciated
>
> [code]
> (defun printpdf (/ fileloc filenam)
> (setq fileloc (strcat (getvar "dwgprefix") (vl-filename-base (getvar
> "dwgname"))))
> (setq filenam (vl-filename-base (getvar "dwgname")))
>
> (command "-plot""y" "" "DWG To PDF.pc3" "ANSI expand A (8.50 x 11.00
> Inches)" "I" "P" "N" "E" "F" "" "Y" "nao.ctb" "Y" "" filenam
> "n" "y")
> )
> [\code]