- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My goal is create a lisp that will automatically set the plot settings. I have tried to piece together a lisp but was not successful in making it work. can someone help me out please and thank you.
(defun c: pltc (/)
(LM:ODBX
(function
(lambda ( doc )
(princ (strcat "\nOpening file : "(vla-get-name doc)))
(vlax-for lay (vla-get-layouts doc)
; (if ( = "Model" (vla-get-name lay))
; (progn
(princ "\nSearching in Model space for Title Block")
(vlax-for blk (vla-get-blocks doc)
(cond
(( = (vla-get-name blk) "Layout1") (setq PaperSize "36X48") (vla-put-PlotRotation lay ac0degrees))
);cond
);vlax-for blocks
(princ (strcat "\nPaper Size for Model Space : " PaperSize))
; );progn
; );if model space
(vla-put-ConfigName lay "DWG To PDF") ;set the plotter
(vla-put-CanonicalMediaName lay 36x48) ;set the paper size
(vla-put-PlotType lay acLayout) ;plot area layout
;(vla-put-CenterPlot lay "1") ;center plot
(vla-put-PaperUnits lay "1") ;set units to mm
(vla-put-PlotWithLineweights lay "1") ;turn on lineweights
(vla-put-PlotWithPlotStyles lay "1") ;turn on plot styles
(vla-put-StandardScale lay ac1_1) ;fit to paper
;(vla-put-PlotRotation lay ac90degrees) ;Drawing orientation 1=portrait 0=landscape
(vla-put-stylesheet lay "KPFF-COLOR-PLAN.ctb") ;set the CTB
(princ (strcat "\nPlot settings done for : "(vla-get-name lay)))
);vlax-for
(princ "\n--------------------------------------------------")
)
)
nil t
)
(princ)
);defun
Solved! Go to Solution.