DraftSight Macro Recording and Batch Printing: Automating Repetitive Tasks
A workflow guide for automating repetitive tasks in DraftSight using macro scripts, batch printing configurations, and command script files (.scr) for multi-sheet output.

DraftSight Macro Recording and Batch Printing: Automating Repetitive Tasks
Repetitive tasks consume hours of productive time in any CAD environment. DraftSight provides several automation pathways — from simple script files to LISP routines to batch printing configurations. This guide covers the most practical automation methods that require minimal programming knowledge but deliver immediate time savings.
Script Files (.scr) for Command Automation
Script files are the simplest form of automation in DraftSight. A script file is a text file containing command-line inputs, one per line, executed sequentially. No programming logic is required.
Creating a Script File
Create a plain text file with .scr extension. Each line represents one command input or prompt response:
;; cleanup.scr - Drawing cleanup script
_.AUDIT
Y
_.-PURGE
_A
*
_N
_.-PURGE
_ST
*
_N
_.-PURGE
_LA
*
_N
_.ZOOM
_E
_.QSAVE
Running a Script File
- Type
SCRIPTat the command line - Select the
.scrfile - DraftSight executes each line sequentially
Script File Rules
- Each line is one input (command name, option, coordinate, or Enter)
- Blank lines represent pressing Enter
- Lines starting with
;;are comments (ignored during execution) - Use
_.prefix for commands to ensure English language execution regardless of locale - Coordinates use the current drawing units
- Spaces within a line are interpreted as Enter presses in some contexts
Practical Script Examples
Batch Layer Setup Script
;; layers-setup.scr - Create standard architectural layers
_.-LAYER
N A-WALL-EXT,A-WALL-INT,A-DOOR,A-WIND,A-FLOR
C 1 A-WALL-EXT
C 4 A-WALL-INT
C 3 A-DOOR,A-WIND
C 8 A-FLOR
N A-ANNO-DIMS,A-ANNO-NOTE,A-ANNO-TTLB
C 7 A-ANNO-DIMS
C 2 A-ANNO-NOTE
C 7 A-ANNO-TTLB
Title Block Attribute Update Script
;; title-update.scr - Update title block attributes
_.-ATTEDIT
N
A-ANNO-TTLB
TITLE
*
Project North Wing Renovation
Y
DWG-NO
*
A-201
Y
DATE
*
2026-06-30
Y
SCALE
*
1:50
Batch Printing Configuration
DraftSight's batch printing tool lets you plot multiple drawings or layouts in a single operation.
Using the PUBLISH Command
- Type
PUBLISHto open the Publish dialog - Click "Add Sheet" to add drawings:
- Select DWG files from disk
- Or select layouts from the current drawing
- For each sheet, configure:
- Page setup: Select a pre-defined page setup or create one inline
- Printer/Plotter: Choose the output device
- Paper size: Match the title block size
- Plot scale: 1:1 for layouts with pre-scaled viewports
- Plot area: Layout (for paper space) or Extents (for model space)
- Set print order using the up/down arrows
- Click "Publish" to start batch printing
Saving Publish Sets
Save the sheet list as a .dsd (Sheet Set Description) file for reuse:
- In the Publish dialog, click "Save Sheet List"
- Name the file (e.g.,
Project-North-Wing-Plot-Set.dsd) - Next time, click "Load Sheet List" to reload the same configuration
Batch Print to PDF
For digital distribution, set the printer to a PDF driver:
- In the Publish dialog, set "Publish To" to "PDF"
- Set output folder
- Choose single-sheet or multi-sheet PDF
- Click "Publish" — DraftSight generates PDF(s) for all sheets
Command Script for Batch File Processing
To run a script across multiple DWG files, use a wrapper script that opens, processes, and saves each file:
Method 1: Using BatchRun Script
Create a master script that DraftSight processes:
;; batch-cleanup.scr - Process multiple files
_.OPEN
C:\Drawings\A-101.dwg
_.AUDIT
Y
_.-PURGE
_A
*
_N
_.QSAVE
_.CLOSE
_.OPEN
C:\Drawings\A-102.dwg
_.AUDIT
Y
_.-PURGE
_A
*
_N
_.QSAVE
_.CLOSE
_.OPEN
C:\Drawings\A-103.dwg
_.AUDIT
Y
_.-PURGE
_A
*
_N
_.QSAVE
_.CLOSE
Run with SCRIPT command and select the master script file.
Method 2: Using LISP for Dynamic File Lists
For more flexibility, use a LISP routine that reads files from a directory:
(defun c:BatchClean ( / dir files file)
(setq dir (getstring "\nDirectory path: "))
(setq files (vl-directory-files dir "*.dwg" 1))
(foreach file files
(command "_.OPEN" (strcat dir "\\" file))
(command "_.AUDIT" "_Y")
(command "_.-PURGE" "_A" "*" "_N")
(command "_.QSAVE")
(command "_.CLOSE")
(princ (strcat "\nProcessed: " file))
)
(princ "\nBatch processing complete.")
(princ)
)
Automating Dimension Style Application
For drawings that come from external sources with incorrect dimension styles:
(defun c:FixDims ( / ss i ent)
(setq ss (ssget "X" '((0 . "DIMENSION"))))
(if ss
(progn
(setq i 0)
(while (< i (sslength ss))
(setq ent (entget (ssname ss i)))
(setq ent (subst (cons 3 "ARCH-25") (assoc 3 ent) ent))
(entmod ent)
(setq i (1+ i))
)
(command "_.DIMREGEN")
(princ (strcat "\nUpdated " (itoa (sslength ss)) " dimensions."))
)
(princ "\nNo dimensions found.")
)
(princ)
)
Scheduled Batch Printing
For overnight or off-peak batch printing:
- Create a
.batfile that launches DraftSight with a script:
@echo off
"C:\Program Files\Dassault Systemes\DraftSight\bin\DraftSight.exe" /b "C:\Scripts\overnight-plot.scr"
- Use Windows Task Scheduler to run the
.batfile at the desired time - Ensure the script includes all necessary print commands and file paths
Best Practices for Automation Scripts
- Always test on copies — never run batch scripts on production files without testing
- Include error handling — add
_.AUDIT Yat the start of each file processing loop - Log results — use
(princ)statements to output progress to the command line; redirect output to a log file with> log.txtin the batch wrapper - Set FILEDIA to 0 — prevents file dialog boxes from interrupting script execution
- Set CMDDIA to 0 — prevents command dialog boxes from interrupting
- Use absolute paths — scripts may not respect the current working directory
- Include QSAVE before CLOSE — ensures changes are saved before the file closes
Batch Print Configuration Best Practices
Based on community discussions and real usage, here are the best practices for DraftSight batch printing. First, always create and save a print configuration for each common output format — one for PDF, one for physical printers, and one for DWF if needed. This ensures consistent output settings across batch print jobs. Second, use the .bpl batch print list file to save your print job configuration — this allows you to reprint the same set of drawings with one click. Third, when publishing multi-sheet PDFs, select "PDF" as the printer name directly in the Print dialog — not "Microsoft Print to PDF" or "Adobe PDF," which may gray out the multi-sheet option. This specific issue was reported on the DraftSight user community and the solution was to scroll down the printer list to find the native "PDF" option. Fourth, for large batch jobs, use the Pause button periodically to check output quality on the first few sheets before continuing. Fifth, always specify an output folder path before starting the batch — if the path is not set, DraftSight may prompt for each file, defeating the purpose of batch processing.
Conclusion
DraftSight's automation capabilities — script files, batch printing, and LISP routines — provide practical time savings for any team doing repetitive CAD work. Script files require no programming and can handle cleanup, layer setup, and attribute updates. The PUBLISH command handles multi-sheet printing with reusable configurations. For more advanced automation, LISP routines provide file looping and conditional logic. By combining these tools, you can eliminate hours of manual work from your weekly CAD workflow.
Source Verification
More Draftsight Guides
workflow
DraftSight 2D Drafting: Layers, Dimension Styles, and Title Block Setup
12 min read
troubleshooting
DraftSight Installation Errors and Activation Failures: Complete Troubleshooting Guide
12 min read
workflow
DraftSight PDF Import and DWG Export: Clean Geometry Conversion Workflow
10 min read
comparison
DraftSight vs AutoCAD: Feature Comparison, Command Differences, and Migration Guide
13 min read
Related workflow Guides
Similar workflow content for other CAD tools
Abaqus
•workflow
Abaqus Composite Material Analysis: Laminate Modeling, Damage, and Progressive Failure
12 min read
Abaqus
•workflow
Abaqus Contact Mechanics: General Contact, Friction, and Wear Simulation
12 min read
Abaqus
•workflow
Abaqus/Explicit Dynamic Analysis: Crash, Drop Test, and High-Speed Impact Simulation
13 min read
Abaqus
•workflow
Abaqus Fracture Mechanics: XFEM, Cohesive Zone, and J-Integral for Crack Propagation
12 min read