(if (findfile fname....
--
Matt W
There are 3 kinds of people:
Those who can count, and those who can't.
"spencer1971" wrote in message
news:23687418.1086884657291.JavaMail.jive@jiveforum1.autodesk.com...
| I have written this lisp to block out an area of a drawing and create a
pdf. Unfortunately it chrashes in the file that it is trying to create is
already present,
|
| Can anyone suggest a way to check for the variable fname prior to tyring
to write the block,
|
| Also, Is it possible to write an error function into this lisp or does the
fact that it jumps from one drawing to another mean that this is not
possible.
|
|
| (Defun c:ext (/ nsheet dname dname1 dpref oldname fname pt1 ss1 echo)
| (setq ECHO (GETVAR "CMDECHO"))
| (SETVAR "CMDECHO" 0)
| (setvar "lispinit" 0)
| (setq sheetno (getstring "\nsheet number (if allready converted then
delete old files) ?: "))
| (setq dname (getvar "dwgname"))
| (setq dname1 (substr dname 1 (- (strlen dname) 4)))
| (setq dpref (getvar "dwgprefix"))
| (setq oldname (strcat dpref dname1))
| (setq fname (strcat "C:/My Documents/PLOTFILES/" dname1 "-sched-"
sheetno))
| (setq pt1 (getpoint "\npick left hand corner of sheet?: "))
| (setq ss1 (ssget))
| (command "sdi" "1")
| (command "-wblock" fname "" pt1 ss1 "")
| (command "undo" "1")
| (command "qsave")
| (command "fileopen" fname)
| (command "plot" "y" "" "pdf995" "a4" "m" "p" "n" "e" "f" "0,0" "y"
"a3.ctb" "y" "n" "n" "n" "y" "")
| (command "fileopen" "y" oldname)
| (setvar "lispinit" 1)
| (command "sdi" "0")
| (SETVAR "CMDECHO" ECHO)
| (princ)
| )
|
| Many thanks
|
|
| Spencer