BIM

Batch plotting in AutoCAD: an open lisp you can read

Batch plotting in AutoCAD turns a whole set of title blocks into PDFs in one pass. An open-source lisp, plus the 17-step plot sequence measured on AutoCAD 2027.

  • TS. Đỗ Quốc Hoàng
  • 10 min read
Four A3 title blocks laid out in model space, turned into four PDF files by a single command Photo: Screenshot taken on AutoCAD 2027 at the Institute

A thirty-sheet set plotted one sheet at a time eats an afternoon, which is why batch plotting in AutoCAD is the second most downloaded kind of lisp there is. The catch is that the most widely shared file comes compiled, so you cannot read what it does before loading it into your machine.

This article measures the real plot sequence on AutoCAD 2027 at the Institute, shows why plotting by hand takes so long, and offers the Institute's file with its source left open. For the whole documentation and printing workflow, see the AutoCAD for Construction course.

The plot command is already there, but it is long-winded

AutoCAD plots without any lisp, through the -PLOT command. That is the command-line form of plotting, and it is what every batch-plot lisp calls underneath.

The trouble is how much it asks. We ran one pass on AutoCAD 2027 and copied every prompt verbatim — seventeen questions for one sheet.

Detailed plot configuration? [Yes/No] <No>:
Enter a layout name or [?] <Model>:
Enter an output device name or [?] <...>:
Enter paper size or [?] <...>:
Enter paper units [Inches/Millimeters] <Inches>:
Enter drawing orientation [Portrait/Landscape] <Portrait>:
Plot upside down? [Yes/No] <No>:
Enter plot area [Display/Extents/Limits/View/Window] <Window>:
Enter lower left corner of window <...>:
Enter upper right corner of window <...>:
Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <Fit>:
Enter plot offset (x,y) or [Center] <0.00,0.00>:
Plot with plot styles? [Yes/No] <Yes>:
Enter plot style table name or [?] (enter . for none) <...>:
Plot with lineweights? [Yes/No] <Yes>:
Enter shade plot setting [As displayed/...] <As displayed>:
Enter file name <...>:
Save changes to page setup [Yes/No]? <N>
Proceed with plot [Yes/No] <Y>:

Multiply seventeen by thirty sheets and the appetite for a lisp explains itself. After each sheet AutoCAD also reports the area it actually used, for example Effective plotting area: 420.00 wide by 297.00 high.

One small detail that saves a lot of grief: the paper name must be typed exactly. To see the list, answer the paper question with a question mark and AutoCAD prints them all. The line for landscape A3 reads ISO full bleed A3 (420.00 x 297.00 MM). That is the string a lisp needs.

A compiled file you cannot read

We downloaded the most widely shared batch-plot lisp and opened it. It is not a .lsp file but a .VLX — a compiled one.

A few measurements on that file: 23,964 bytes, starting with the identifier VRTLIB-1, and on the next line a declaration of (:protected . T). We scanned the whole file for the string (defun, which begins every AutoLISP function, and found not one occurrence.

To be fair: compiling is the author's right, and nothing suggests the file does anything wrong. But the consequences are plain.

You cannot read what it does. You cannot change its default paper size or plot style. And when AutoCAD raises the Security - Unsigned Executable File dialog asking whether to load it, you have no way of checking for yourself before answering. Handling that dialog is covered in our article on numbering lisps.

So the Institute's file stays a plain .lsp. Open it in Notepad and every line is there.

Three routes Photo: Three ways to plot a whole set, differing in effort and in whether you can read the code

IN-IIC.lsp: one title block, one PDF

Download IN-IIC.lsp — 10 KB, three commands, source left open.

CommandWhat it does
INHLplots by title block, sorted into rows then left to right
INHLCplots by rectangles on one layer, no block needed
INHL1plots a single frame so you can check the settings first

All three ask the same seven settings: plotter, paper size, plot style, orientation, output folder, filename prefix and start number. They are remembered for the session, so the next run is all Enters.

The call to the plot command sits in one small function, with a comment on each line saying which question it answers:

(defun IIC:in-mot (p1 p2 tep / cu)
  (setq cu (getvar "cmdecho"))
  (setvar "cmdecho" 0)
  (command "_.-PLOT"
           "_Y"                                  ; che do chi tiet
           ""                                    ; layout hien hanh
           *iic-may*                             ; may in
           *iic-giay*                            ; kho giay
           "_M"                                  ; don vi milimet
           (if (= *iic-huong* "P") "_P" "_L")    ; huong giay
           "_N"                                  ; khong lat nguoc
           "_W"                                  ; vung in la cua so
           (list (car p1) (cadr p1))             ; goc duoi trai
           (list (car p2) (cadr p2))             ; goc tren phai
           "_F"                                  ; vua khung giay
           "_C"                                  ; can giua
           "_Y"                                  ; co dung kieu in
           *iic-ctb*                             ; ten kieu in
           "_Y"                                  ; in theo be rong net
           ""                                    ; kieu to bong: giu mac dinh
           tep                                   ; ten tep ra
           "_N"                                  ; khong ghi de page setup
           "_Y")                                 ; dong y in
  (setvar "cmdecho" cu)
  ;; Trinh ghi PDF hoan tat SAU khi lenh tra quyen ve: do duoc 20/09/2026, tep
  ;; ke tiep moi co ten ma con 0 byte. Vi vay khong dung (findfile) de ket luan,
  ;; ma chi bao da gui di; cuoi lenh dem lai so tep .pdf mot lan nua.
  t)

INHL1 is the one to run first. Plot a single frame, open the PDF, check the scale and lineweights, and only then run the whole set. A mistake on the test sheet costs one fix; a mistake on the thirtieth costs the whole run.

Using it: the row tolerance decides the order

Step 1 — Load it and declare a trusted folder

Copy the file into a folder of its own, say C:\Lisp, then type APPLOAD and load it. If the security dialog appears, declare that folder trusted under OPTIONS, the Files tab, Trusted Locations.

Step 2 — Plot one test frame

Type INHL1. It asks for two corners, then the seven settings. Open the resulting PDF and check it.

Step 3 — Point at a sample title block

Type INHL. The prompt reads:

Chon MOT khung ten mau (phai la block):

Click any title block. AutoCAD reports the block name it recognised, for example Ten block khung ten: IIC-KHUNG.

Step 4 — Set the row tolerance, then select

Dung sai hang (hai khung lech Y nho hon so nay la cung hang) <1000>:

This number decides the plot order. Frames closer in Y than the tolerance count as one row and plot left to right; the top row finishes before the next begins.

Chon cac khung ten can in:

Window the whole set and press Enter. AutoCAD reports Se in 4 to, theo thu tu tu trai sang phai, tren xuong duoi. and works through them.

Four title blocks Photo: Four A3 title blocks in two rows in model space. One INHL command produced TO-001 to TO-004, in the right order

Step 5 — Let the PDF writer finish

This is the step most likely to look like a failure, and we caught it during testing.

Listing the folder the instant the command returned gave this: TO-001.pdf already at its full 2,142 bytes, while the next file had a name but zero bytes. A few seconds later it was complete. The command had finished; the PDF writer had not.

To be sure of the cause we read the BACKGROUNDPLOT variable on the machine: it stood at 2. By Autodesk's table that means plotting runs in the foreground and only publishing runs in the background. So the lag is not background plotting — it is the PDF writer completing after the command hands control back.

That is why the Institute's file does not decide by looking for the file straight away, which would under-report. It says how many sheets it sent, then counts the .pdf files in the folder so you can compare.

Preparing the drawing: the plot style matters

Three things, done once for good.

The title block must be a block. Every batch-plot lisp requires this, ours included, because the command needs a reliable way to tell where one sheet ends. A frame drawn as loose lines gives it nothing to group. Creating blocks is covered in our article on blocks in AutoCAD.

If an old file already has frames drawn as lines, there is still a way: use INHLC, put a rectangle around each sheet on a layer of its own such as KHUNG-IN, and plot by that layer.

Keep the frames in line. The command sorts by row, so frames in one row should share a similar Y. A few hundred units is what the tolerance is for; a whole metre and AutoCAD sees two rows.

Settle on one plot style. The .ctb file decides which lines print heavy and which print light. Set it once and stop thinking about it. Managing lineweight by layer is covered in our article on layers in AutoCAD.

When to reach for a layout instead

Everything above assumes the Vietnamese habit of laying sheets out side by side in model space. It is not the only way, and it is worth knowing when the other way wins.

A layout holds one sheet with its own paper size, plot style and viewports, and AutoCAD can publish a whole stack of layouts in one go without any lisp at all. If a project is set up that way from the start, that route is tidier: the settings live with each sheet rather than being typed again at every plot.

The reason model space still dominates here is history. Older sets were built that way, subcontractors send files that way, and changing a whole office's habit mid-project costs more than it saves. So both routes stay useful, and the lisp exists for the one that has no built-in equivalent.

What does not change either way: the plot style table decides the lineweights, and a test sheet before the full run saves the most time of anything in this article.

Three things often repeated that are not true

Often repeatedWhat the 2027 release does
Batch plotting needs a lisp-PLOT does it, at seventeen answers per sheet
Any lisp can be read, it is a text fileThe most shared file is a compiled .VLX declaring (:protected . T)
When the command ends, the files are thereMeasured: the next file had a name and zero bytes, complete seconds later

Frequently asked questions

Can batch plotting in AutoCAD go straight to PDF?

Yes. Answer the first question with DWG To PDF.pc3 and give an output folder. Each sheet becomes its own file, numbered in sequence.

Where can I download a lisp for batch plotting in AutoCAD safely?

From somewhere you know, and prefer a readable .lsp over a compiled .VLX. Open it in a text editor before loading it.

AutoCAD says I picked the wrong thing when I click the title block.

Your title block is not a block. Use INHLC instead and put a rectangle around each sheet on a layer of its own.

The plot order comes out scrambled.

Raise the row tolerance. If frames in one row differ in Y by more than that number, AutoCAD treats them as separate rows.

Can it plot from layouts?

This file plots windows in model space, which is how most Vietnamese documentation is set up. For a set built around layouts, AutoCAD's own publishing command is the tidier route.

Why is the folder short of files when it says it has finished?

Because the PDF writer completes after the command hands control back. Wait a few seconds, and watch for the Plot and Publish Job Complete balloon at the bottom right.

About the author

TS. Đỗ Quốc Hoàng — Vice Director of the Institute of Information Technology in Civil Engineering, Hanoi University of Civil Engineering, and a specialist in software development for construction