How do I batch plot / publish ALL layout tabs to PDF?


One of the most-asked questions on the forum: plot every layout tab in every drawing — to a PDF or a plotter — without opening each file and clicking through the plot dialog. Hurricane runs a plot script across your whole drawing set; the trick is making the script loop over all the layout tabs in each file.

Start from Hurricane's built-in "Plot all Tabs" script

Hurricane ships with a "Plot all Tabs" sample script you can use as a base — you only need to edit it to point at your plotter and adjust the paper size, orientation, and plot-area settings. It uses a small LISP loop: (layoutlist) returns every layout in the drawing, and the script sets each one current (ctab) and calls the command-line -PLOT command:

;START OF SCRIPT ------------------------------
;ABORT=TRUE
(if (= "Model" (getvar "ctab"))
  (command "_-plot" "_Yes" "" "\\\\SERVER\\PRINTER" "11 x 17"
           "_Inches" "_Landscape" "_No" "_Display" "_Fit"
           "0.00,0.00" "_Yes" "" "_Yes" "_No" "" "_No" "_Yes"))
(progn
  (foreach laylist (vl-remove "Model" (layoutlist))
    (setvar "ctab" laylist)
    (command "_-plot" "_Yes" "" "\\\\SERVER\\PRINTER" "11 x 17"
             "_Inches" "_Landscape" "_No" "_Display" "_Fit"
             "0.00,0.00" "_Yes" "" "_Yes" "_No" "_No" "_No" ""
             "_No" "_Yes")))
;END OF SCRIPT ------------------------------

Swap \\SERVER\PRINTER and 11 x 17 for your output device and paper size. To produce PDFs, use the DWG To PDF.pc3 device as the plotter name.

The -PLOT prompt sequence

If you'd rather write the plot script by hand (one layout at a time), -PLOT is the command-line, no-dialog version of PLOT. Every answer in your script must line up with these prompts, in order. A real DWG-to-PDF run looks like this:

-PLOT
Detailed plot configuration? [Yes/No]      : Yes
Enter a layout name                         : (layout, or Model)
Enter an output device name                 : DWG To PDF.pc3
Enter paper size                            : ISO full bleed A3 (420 x 297 MM)
Enter paper units [Inches/Millimeters]      : Millimeters
Enter drawing orientation [Portrait/Landscape] : Landscape
Plot upside down? [Yes/No]                  : No
Enter plot area [Display/Extents/Limits/View/Window] : Extents
; ...scale, offset, plot style table, shade, write-to-file, save changes, proceed...
Why plot scripts "skip" answers (the #1 batch-plot bug): if AutoCAD pops a dialog, your answers fall out of step and the script feeds the wrong value to the wrong prompt. Before plotting, set FILEDIA to 0 and CMDECHO to 0, and make sure the number of answers in your script exactly matches the -PLOT prompts for your AutoCAD version (the prompt list changed slightly between releases). See When I try to run a script, a dialog box appears and the script stops and the System Variable Reference.
Multi-sheet PDF: -PLOT writes one file per layout. If you instead want a single combined PDF (or DWF) of many sheets, the -PUBLISH command with a Drawing Set Description (DSD) file is the tool — also fully scriptable through Hurricane.
💬 From the Hurricane Forum: How do I Batch Plot all Layout Tabs? (the script above) · Plot script skipping answers — troubleshooting · PDF plotter scripts

Related


PreviousBack to Hurricane for Autodesk® AutoCAD® - FAQNext