The Lisp has to set 22 times,:yes: try with DWG To PDF
22 different output file names.
Is it possible ?
The amount of time wasted on figuring out how to do something the wrong way astounds me.
But I need to assignvla-PlotToFile
the plot output PDF file name, via VLISP.
Is it possible ?
vla-PlotToFile
; plot all title blocks in model space
; By Alan H 2005
(PROMPT ".....PRINTING DRAWING TO plotter....")
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)
: Da1drsht is titel block name
(setq ss2 (ssget "x" '((0 . "INSERT")(2 . "Da1drsht")(410 . "Model"))))
(setq n (sslength ss2))
(setq index 0)
(repeat n
(setq en (ssname ss2 index))
(setq el (entget en))
(setq inspt (assoc 10 el)) ; insertion pt this is lower left for this code
(setq xmin (- (cadr inspt) 6.0))
(setq ymin (- (caddr inspt) 6.0))
(setq xymin (strcat (rtos xmin 2 1) "," (rtos ymin 2 1)))
(setq xmax (+ xmin 813.0)) ; hard coded for 813 wide 6mm offset
(setq ymax (+ ymin 566.0)) ;hard code for 566 high
(setq xymax (strcat (rtos xmax 2 1) "," (rtos ymax 2 1)))
(COMMAND "-PLOT" "Y" "" "Design-5100"
"A3" "M" "LANDSCAPE" "N"
"W" xymin xymax "1=2" "C"
"y" "Designlaser.ctb" "Y" "" "n" "n"
"y"
)
(setq index (+ index 1))
)
(setvar "osmode" oldsnap)
(princ)
show me an example, please
(vl-load-com)
(defun PlotToFile (ConfigName MediaName Window FileName / AcadObj ActiveDocObj ActiveLayoutObj PlotObj)
(setq AcadObj (vlax-get-acad-object)
ActiveDocObj (vla-get-ActiveDocument AcadObj)
ActiveLayoutObj (vla-get-ActiveLayout ActiveDocObj)
)
(vla-RefreshPlotDeviceInfo ActiveLayoutObj)
(vla-Put-ConfigName ActiveLayoutObj ConfigName)
(setq PlotObj (vla-get-Plot ActiveDocObj))
(vla-Put-CanonicalMediaName ActiveLayoutObj MediaName)
(vla-Put-StandardScale ActiveLayoutObj acScaleToFit)
(vla-Put-PlotRotation ActiveLayoutObj ac0degrees)
(vla-put-PlotOrigin
ActiveLayoutObj
(vlax-make-variant (vlax-make-safearray vlax-vbDouble '(0 . 1)))
)
(vla-Put-CenterPlot ActiveLayoutObj :vlax-false)
(vla-SetWindowToPlot
ActiveLayoutObj
(vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1)) (car Window)))
(vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1)) (cadr Window)))
)
(vla-Put-PlotType ActiveLayoutObj acWindow)
(vla-PlotToFile PlotObj FileName)
(foreach o (list PlotObj ActiveLayoutObj ActiveDocObj AcadObj) (vlax-release-object o))
)
(PlotToFile "DWG To PDF.pc3"
"ANSI_A_(11.00_x_8.50_Inches)"
(list (list 0 0) (list 100 100))
(strcat (getvar "DWGPREFIX") (getvar "DWGNAME") ".pdf")
)
but for PDFcreatori do not use PDFCreator
in few seconds, and with only with 1 (one) command !that's what homos have been dreaming about for two million years :)
that's what homos have been dreaming about for two million years :):laugh:
(vla-SetWindowToPlot
ActiveLayoutObj
(vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1)) (car Window)))
(vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1)) (cadr Window)))
)
:yes:
(vla-SetWindowToPlot
ActiveLayoutObj
(vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1)) (car Window)))
(vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1)) (cadr Window)))
)
(vla-Put-PlotType ActiveLayoutObj acWindow)
Marco, I don't understand whay you want mean !do not completely change a message you have already posted, make a new one otherwise we do not understand anything
do not completely change a message you have already posted,ok !
make a new one otherwise we do not understand anything
Normally the VovKa codeyou've made some changes to my code
works perfectly !
. . .
But today . . .
. . .
What happens ?
I have used this code many dozen times. . .just try my unmodified code and say if it's working or not
...You have used a old version of the code :yes: :blink:
. . . evidently I have made some mess, :whistling:
and I have not noticed it!
...