I just want to start by saying I am a lisp novice. I am trying to get the following to plot layout tabs to a given location. I keep getting an error and the plot does not run. Can someone help?
Here is my code:
(defun c:plotlayouts (/ layoutname layt_lst)
(vl-load-com)
(vlax-for layt (vla-get-layouts (vla-get-ActiveDocument (vlax-get-acad-object)))
(if (> (vla-get-TabOrder layt) 0)
(setq layt_lst (cons (cons (vla-get-TabOrder layt) (vla-get-Name layt)) layt_lst))
)
)
(setq layt_lst (vl-sort layt_lst '(lambda (x y) (< (car x) (car y)))))
(foreach layt layt_lst
(setq layoutname (cdr layt))
;
(setq dname (getvar "dwgname"))
(setq projname (substr dname 1 4))
(setq date (rtos (getvar "cdate") 2 6))
(setq year (substr date 1 4))
(setq month (substr date 5 2))
(setq day (substr date 7 2))
(setq location1 (strcat "Q:\\RCMA RESOURCES\\Plots Temp\\" projname " (" year "-" month "-" day ")"))
(vl-mkdir location1)
(setq location2 (strcat location1 "\\" projname "Plotfile"))
(vl-mkdir location2)
(setq location3 (strcat location1 "\\" projname "PDF"))
(vl-mkdir location3)
(setq plotdir location2)
(setq pdfdir location3)
(setq plotname pfname)
(setq location (strcat plotdir "\\" plotname))
(setq location2 (strcat pdfdir "\\" plotname))
;
(command "-plot"
"yes";DETAILED PLOT
layoutname
"KIP7000 PLOTFILE.pc3";PLOTTER NAME
"24x36in." ;PAPER SIZE
"inches" ;PAPER UNITS
"landscape" ;ORIENTATION
"no" ;PLOT UPSIDEDOWN
"extents" ;PLOT AREA
"1:1" ;PLOT SCALE
"center" ;PLOT OFFSET
"yes" ;USE PLOT SYTLES?
"RCMA-FULL.CTB" ;PLOT STYLE NAME
"yes" ;PLOT LINEWEIGHTS
"no" ;SCALE LINEWEIGHTS
"no" ;PAPER SPACE FIRST
"no" ;HIDE PAPER SPACE
"yes" ;PLOT TO FILE
location
"yes" ;SAVE PAGE SETUP
"yes" ;PROCEDE WITH PLOT
)
;
)
(princ)
)
Solved! Go to Solution.
Solved by rcma2015. Go to Solution.