Message 1 of 5
PLOT all tabs using LISP (Not Using PUBLISH)

Not applicable
11-30-2018
08:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Everyone,
I have a LISP function that currently plots my "Model" tab using the PLOT function. I have the function run in the background without any user intervention after a user clicks a shortcut in AutoCAD. A PDF of the "Model" tab is automatically saved to my selected default directory.
My goal is to print not just my "Model" tab but all of the tabs in the particular DWG file. Sometimes the other tabs are named "Layout", "Revision", as well as others. I would like to have all these tabs saved onto ONE PDF file.
I know the PUBLISH command performs a similar function but that requires a manual setup by the user and I want to avoid that at all costs which is why I use the PLOT function shown below.
Help would be greatly appreciated.
(defun C:PDFSave (/ filename) (vl-load-com) (princ "\n Saving PDF of floor plan... ") (princ "\n") (setvar "cmdecho" 0) ;;Set file save location (setenv "PlotToFilePath" "X") (setenv "PlotToFilePath" "Y") (setq filename (vl-filename-base (getvar 'dwgname))) (setq filename (strcat "X\\" (vl-filename-base (getvar 'dwgname)) ".pdf")) ;;Start Plotting (command "-plot" ; Start plot command "y" ; Detailed plot configuration? "Model" ; Get current layout name "DWG to PDF.pc3" ; Enter an output device name "ARCH full bleed D (24.00 X 36.00 Inches)" ; Enter paper size "Inches" ; Enter paper units "Landscape" ; Enter drawing orientation "No" ; Plot upside down? "Extents" ; Enter plot area "Fit" ; Enter plot scale "Center" ; Enter plot offset (x,y) "Yes" ; Plot with plot styles? "." ; Enter plot style table name or "No" ; Plot with lineweights? "As Displayed" ;Enter shade plot setting filename "No" ; Save changes to page setup "Yes" ; Proceed with plot ) (princ "\n PDF Save Successfully Completed!. ") (setvar "cmdecho" 1) (princ) )