;autoplot - programmed to be used with RUN LISP, our drawing batch processing program.

;Each drawing must have a predefined view named 'plotview'
;of the area to be plotted. 
 
;The current default plot parameters must be correct and must be set 
;to plot to a file.

;The system variables CMDDIA and FILEDIA must be set to zero.

;Creates a plot file (dwgname.plt) for each drawing selected by
;RUN LISP

;Copyright (c) 1995 by Sierra Hermitage
;
;Sierra Hermitage
;Rod Young, programmer
;140 Mesa Vista Drive
;Bishop, CA  93514
;Phone 619-387-2479 (voice)   619-387-2488 (data/fax, seldom enabled)
;E-mail hermit1@ix.netcom.com

(defun autoplot()
	;plot this drawing using current defaults
	(command "_plot" "view" "plotview" "n" (strcat (getvar "DWGNAME") ".PLT") )
	;overwrite old plot if needed
	(if (= (findfile (strcat (getvar "DWGNAME") ".PLT")) (strcat (getvar "DWGNAME") ".PLT"))
		(command "y" )
	);end if	
	(princ)	;clean run
);end defun
;make this program 'load and go' by running itself
;be sure to do this for all programs to be used with RUN LISP
(autoplot)
(princ)	;clean load