Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP TO PLOT LAYOUT TABS TO A LOCATION

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
rcma2015
431 Views, 4 Replies

LISP TO PLOT LAYOUT TABS TO A LOCATION

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)

)

4 REPLIES 4
Message 2 of 5
Jeff_M
in reply to: rcma2015

What is the error you get?
Jeff_M, also a frequent Swamper
EESignature
Message 3 of 5
rcma2015
in reply to: rcma2015

error: bad argument type: stringp nil

Message 4 of 5
Jeff_M
in reply to: rcma2015

This line:

(setq plotname pfname)

 

The pfname variable has not been defined anywhere. Not sure what this supposed to be.

Jeff_M, also a frequent Swamper
EESignature
Message 5 of 5
rcma2015
in reply to: Jeff_M

Thanks, I just found that.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report