this lisp used to work, but now I have to uncheck "display printable area" and "display paper background" to get it to work.
;;;
;;; TITLE:AUTOFILE
;;;
;;; Copyright (C) 2005 by Andy Hudson
;;;
;;; Permission to use, copy, modify, and distribute this
;;; software and its documentation for any purpose and without
;;; fee is hereby granted
;;;
;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR
;;; IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY
;;; PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY
;;; DISCLAIMED.
;;;
;;; Andy Hudson
;;; April 2005
;;;
;;;-------------------------------------------------------------
;;; Description:
;;;
;;; Routine to determine drawing size and then
;;; plot to file using appropriate sheet size
;;;
;;;-------------------------------------------------------------
;;; COMMAND LINE: AUTOFILE
;;;-------------------------------------------------------------
(defun c:AUTOFILE
(/ limin limax limit-width limit-height plot-it)
;;
(setvar "TILEMODE" 0)
;;-----------------------------------
;;-----------------------------------
(defun plot-it (device-name paper-size /)
(command "zoom" "extents") ;zoom extents
(command "-PLOT" ;Plot the drawing
"Y" ;Detailed plot configuration
"" ;Enter a layout name
device-name ;Enter an output device name
paper-size ;Enter paper size
"millimeters" ;Enter paper units [Inches/Millimeters]
"landscape" ;Enter drawing orientation [Portrait/Landscape]
"no" ;Plot upside down? Yes/No
"extents" ;Enter plot area
"1:1" ;Enter plot scale
"center" ;Enter plot offset
"yes" ;Plot with plot styles?
"rybka battle - STANDARD.ctb"
;Enter plot style table name
"yes" ;Plot with lineweights?
"no" ;Scale lineweights with plot scale?
"no" ;Plot paper space first?
"no" ;Hide paperspace objects?
"yes" ;Write the plot to a file
"" ;filename
"NO" ;Save changes to page setup
"yes" ;Proceed with plot
)
)
;;-----------------------------------
;;-----------------------------------
;;;GET THE CO-ORDINATES
(setq limin (getvar "LIMMIN")
limax (getvar "LIMMAX")
limit-width (- (car limax) (car limin))
limit-height (- (cadr limax) (cadr limin))
)
;;
(cond ((>= limit-width 1180)
(princ "\nA0")
(setq device-name "\\\\GLASGOW\\1050"
paper-size "ISO A0 - 841 x 1189 mm."
)
)
((and (< limit-width 1180)
(>= limit-width 840)
)
(princ "\nA1")
(setq device-name "\\\\GLASGOW\\1050"
paper-size "ISO A1 - 594 x 841 mm. (landscape)"
)
)
((and (<= limit-width 420)
(>= limit-width 297)
)
(princ "\nA3")
(setq device-name "\\\\GLASGOW\\1050"
paper-size "ISO A3 - 297 x 420 mm. (landscape)"
)
))
;;
(if paper-size
(plot-it device-name paper-size)
)
;;
(princ)
)
Or is there a way I can change these setting via a lisp?