;------------------------------------------------------------------------------- ; PlotLayout - Function that Plots Layouts ;------------------------------------------------------------------------------- (defun PlotLayout (Layout$ PlotDevice$ PaperSize$ MediaSize$ PlotStyle$ / ExtMax ExtMin Flip$ List@ LtScale~ Offset$ Orientation$ PlotScale~ Widest~ X-Max~ X-Min~ Y-Max~ Y-Min~) (setq LtScale~ (getvar "LTSCALE")) (setq Orientation$ (GetOrientation)) (foreach List@ *PlotterInfo@ (if (member PlotDevice$ List@) (setq Flip$ (nth 2 (member PaperSize$ List@)) Offset$ (nth 3 (member PaperSize$ List@)) );setq );if );foreach (if (= Layout$ "Model") (progn (setq ExtMin (getvar "EXTMIN") X-Min~ (nth 0 ExtMin) Y-Min~ (nth 1 ExtMin) ExtMax (getvar "EXTMAX") X-Max~ (nth 0 ExtMax) Y-Max~ (nth 1 ExtMax) );setq (if (> (- X-Max~ X-Min~) (- Y-Max~ Y-Min~)) (setq Widest~ (- X-Max~ X-Min~)) (setq Widest~ (- Y-Max~ Y-Min~)) );if (cond;Change 0.25 to your preferred ltscale ((= PaperSize$ "A5-Size")(setq PlotScale~ (* (/ Widest~ 210.0) 0.25))) ((= PaperSize$ "A4-Size")(setq PlotScale~ (* (/ Widest~ 297.0) 0.25))) ((= PaperSize$ "A3-Size")(setq PlotScale~ (* (/ Widest~ 420.0) 0.25))) ((= PaperSize$ "A2-Size")(setq PlotScale~ (* (/ Widest~ 594.0) 0.25))) ((= PaperSize$ "A1-Size")(setq PlotScale~ (* (/ Widest~ 841.0) 0.25))) );cond (if (> PlotScale~ 0) (progn (setvar "LTSCALE" PlotScale~) ;----------------------------------------------- ;get the points what define the area plot ; ;----------------------------------------------- (setq p1 (cdr (assoc 10 (entget (ssname (ssget "x" '((8 . "P1_PRINT"))) 0)) ) ) ) (setq p2 (cdr (assoc 10 (entget (ssname (ssget "x" '((8 . "P2_PRINT"))) 0)) ) ) ) (command "-PLOT" "Y" Layout$ PlotDevice$ MediaSize$ "M" Orientation$ Flip$ "W" p1 p2"F" Offset$ "Y" PlotStyle$ "Y" "" "N" "N" "Y") );progn (princ "\nNothing to plot on layout Model.") );if );progn (progn (setvar "LTSCALE" 0.25);Change 0.25 to your preferred ltscale ;----------------------------------------------- ;get the points what define the area plot ; ;----------------------------------------------- (setq p1 (cdr (assoc 10 (entget (ssname (ssget "x" '((8 . "P1_PRINT"))) 0)) ) ) ) (setq p2 (cdr (assoc 10 (entget (ssname (ssget "x" '((8 . "P2_PRINT"))) 0)) ) ) ) (command "erase" "l" "") (command "-PLOT" "Y" Layout$ PlotDevice$ MediaSize$ "M" Orientation$ Flip$ "W" p1 p2 "F" Offset$ "Y" PlotStyle$ "Y" "N" "N" "N" "N" "N" "Y") );progn );if (command "ZOOM" "E") (setvar "LTSCALE" LtScale~) );defun PlotLayout