Mike,
attached is what I do :
This is intended to run from a toolbar button per drawing, not through publisher
Note that I haven't modified the code, so you may want to.
I extract the revision number from the border and append it to the base file name.
The PlotConfigurations are deleted and replaced from a template drawing ... not critical
A folder is made under the Drawing Folder
The PDF is created there.
;;;---------------------------------------------------------------------------
;;; CodeHimBelonga kdub@theSwamp
;;;
;;; (c:DWGToPDF_A1)
(defun C:DWGToPDF_A1 (/ old-expert rev_value PDFPath dwgname PDFName)
(DeleteAllPlotConfigurations)
(setq old-expert (getvar "EXPERT"))
(setvar "EXPERT" 5)
;; (or (kdub:stringprintable-p (setq rev_value (_getBorderRevision)))
;; (setq rev_value "--")
;; )
;; Workaround for forum posting
(setq rev_value "--")
(setq PDFPath (strcat (getvar "DWGPREFIX") "PDF\\")
dwgname (vl-filename-base (getvar "DWGNAME"))
PDFName (strcat PDFPath dwgname "[REV " rev_value "].PDF")
)
(vl-mkdir PDFPath)
(if (and (vl-cmdf "-psetupin"
"C:/kdub_SteelTools/BLOCKS/_PLOT_Template_2011.DWG"
"*"
)
(vl-cmdf "-plot" "no" "Model" "DWGToPDF_A1"
"DWG To PDF.pc3" PDFName "No"
"yes"
)
)
(princ (strcat "PDF File Created: " PDFName))
(princ "Failed to create PDF File ")
)
(setvar "EXPERT" old-expert)
(princ)
)
;;;---------------------------------------------------------------------------
;;;---------------------------------------------------------------------------
;;;
(defun DeleteAllPlotConfigurations ()
(vl-load-com)
(vlax-for ps (vla-get-plotconfigurations
(vla-get-activedocument (vlax-get-acad-object))
)
(vla-delete ps)
)
)
;;;---------------------------------------------------------------------------