If you spend an hour or two a day on repetitive ZWCAD work — fixing layers, plotting drawings one by one, numbering title blocks by hand — ZWCAD automation will pay for itself quickly. This guide is written for design engineers, CAD managers and IT admins, and summarizes manufacturer documentation on automation options for construction, mechanical and infrastructure workflows.
What we cover:
- The four automation layers in ZWCAD: Scripts, LISP, VBA, ZRX/.NET
- A comparison table: which tool for which job
- Two copy-paste examples: a layer-standardization LISP and a batch cleanup script
- How to use AI agents (ChatGPT, Claude) to write LISP for you — safely
- FAQ
The four ZWCAD automation layers
ZWCAD inherits the AutoCAD programming ecosystem almost wholesale, so most knowledge and code you find online transfers directly. Per ZWSOFT’s developer documentation, ZWCAD supports:
1. Script files (.scr) — the simplest layer
A script is a plain text file of ZWCAD commands, one per line, executed with the SCRIPT command. No programming required: if you can type it on the command line, you can script it. The limitation: no conditions, no loops — a script just replays keystrokes.
2. LISP — the CAD engineer’s Swiss Army knife
ZWCAD ships with a built-in LISP interpreter that is AutoLISP-compatible. ZWSOFT’s official LISP Migration FAQ states the LISP interface was designed to be consistent with AutoCAD, so most existing AutoLISP programs run on ZWCAD unmodified; ZWCAD 2025+ even loads compiled .vlx/.fas files directly. Load .lsp files with APPLOAD, or add them to the Startup Suite to auto-load on every session.
3. VBA — when you need dialogs and Excel
ZWCAD Professional includes a VBA environment with the familiar ActiveX/COM object model. VBA shines when you need input forms or an Excel bridge — reading rebar schedules, exporting quantity tables.
4. ZRX and the .NET API — the professional layer
For large, performance-critical applications, ZWSOFT provides the ZRXSDK (C++, the ObjectARX counterpart) and a .NET API (C#, VB.NET). This is what commercial vertical apps on top of ZWCAD are built with. SDKs and guides are downloadable from the ZWCAD Developer Documentation page.
Which tool for which job?
| Criteria | Script (.scr) | LISP | VBA | ZRX / .NET |
|---|---|---|---|---|
| Learning curve | Very easy | Moderate | Moderate | Steep |
| Extra installs | None | None | None (Pro) | Visual Studio + SDK |
| Conditions and loops | No | Yes | Yes | Yes |
| User interface | No | Basic (DCL) | Full forms | WPF/WinForms |
| Heavy-data performance | — | Good | Good | Excellent |
| Best for | Fixed repetitive steps, batch runs | Everyday custom commands | Excel integration, forms | Commercial tools, heavy processing |
In our deployments, about 80% of real-world automation needs are solved with LISP plus scripts — no .NET required.
Example 1: a working layer-standardization LISP
The classic problem: a subcontractor’s drawing has text scattered across dozens of layers, and your standard says all TEXT/MTEXT belongs on KT-TEXT. Save this as fixlayer.lsp:
;; FIXLAYER.lsp - Move all TEXT/MTEXT to layer KT-TEXT
(defun c:FIXLAYER (/ ss i ent)
;; Create layer KT-TEXT (color 3, green) if missing
(if (null (tblsearch "LAYER" "KT-TEXT"))
(command "_.-LAYER" "_New" "KT-TEXT" "_Color" "3" "KT-TEXT" "")
)
;; Select every TEXT and MTEXT in the drawing
(setq ss (ssget "_X" '((0 . "TEXT,MTEXT"))))
(if ss
(progn
(setq i 0)
(repeat (sslength ss)
(setq ent (entget (ssname ss i)))
(entmod (subst (cons 8 "KT-TEXT") (assoc 8 ent) ent))
(setq i (1+ i))
)
(princ (strcat "\nMoved " (itoa (sslength ss))
" entities to layer KT-TEXT."))
)
(princ "\nNo TEXT/MTEXT found.")
)
(princ)
)
Load it with APPLOAD, then run FIXLAYER. The pattern — ssget "_X" to scan the whole drawing, entmod on DXF group 8 — is the foundation you can adapt to any standardization task: colors, linetypes, text styles.
Example 2: batch cleanup across hundreds of DWGs
Create cleanup.scr:
_.-PURGE _All * _No
_.AUDIT _Yes
_.ZOOM _Extents
_.QSAVE
Then drive it across a whole folder with a Windows batch file (adjust the install path):
for %%f in ("D:\Projects\*.dwg") do start /wait "" ^
"C:\Program Files\ZWSOFT\ZWCAD 2026\ZWCAD.exe" "%%f" /b "D:\Scripts\cleanup.scr"
The /b switch tells ZWCAD to run the script on startup for each file. On handover sets of several hundred DWGs, this turns opening and cleaning each file by hand into a single unattended run. Always rehearse on a copy of the folder first.
For plotting specifically, try the built-in tool before writing code: ZWCAD’s SMARTPLOT (Smart Batch Plot) detects title block frames by layer or block and prints whole drawing sets in one run; the 2026 release adds automatic paper-size matching.
Using AI agents to write your LISP
Here is the force multiplier: you no longer need to learn LISP syntax to get custom commands. Describe the task to an AI assistant (ChatGPT, Claude) and it writes AutoLISP — which, thanks to ZWCAD’s compatibility, runs as-is. CAD training providers such as IMAGINiT have documented this workflow for AutoCAD since 2023; everything in it applies to ZWCAD.
A prompt formula that consistently works (our five-part structure):
- Context: “Write AutoLISP for ZWCAD (AutoCAD-compatible).”
- Command name: e.g.
NUMBER. - Behavior, step by step: “ask for a prefix and start number; on each picked point, insert a TEXT with the next number; Enter ends the command.”
- Constraints: text height 2.5, current layer, use
entmakerather thancommand. - Quality bar: comments, clean exit with
(princ), all local variables declared.
Non-negotiable verification rules before trusting AI-generated code:
- Never run first drafts on production files. Test on an empty drawing, then on a copy.
- Watch for the common failure modes: rarely-used Visual LISP (
vlax-...) calls, system variables that don’t exist in ZWCAD, undeclared local variables, andcommandsequences with mismatched Enters. Ask the AI to rewrite with plainentget/entmodwhen in doubt. - Test edge cases: empty selection sets, Esc mid-command, negative input.
- A good routine must undo cleanly in a single
UNDOstep. - Don’t paste confidential project DWGs into a chatbot; share the error message and code snippet instead.
If your LISP library comes from AutoCAD, check the API compatibility table in our ZWCAD AutoCAD compatibility guide before you start rewriting anything.
A realistic learning path
- Week 1: master
.scrscripts plus batch files — purging, plotting and publishing are automated immediately. - Weeks 2–4: basic AutoLISP (
defun,ssget,entget/entmod,command), with an AI assistant drafting the code and you verifying it. - When the need arises: VBA for Excel-connected forms; .NET when you are building company-wide tooling.
Also check what already ships in the box: ZWCAD 2026’s Smart Match, Similar Search, Smart Dimension and Smart Select cover many jobs with zero code — see What’s new in ZWCAD 2026.
ZWCAD automation FAQ
Will AutoLISP written for AutoCAD run on ZWCAD?
Mostly yes. ZWSOFT designed the LISP interface to match AutoCAD; failures typically trace to unsupported niche functions or missing system variables, and are usually quick fixes. ZWCAD 2025+ also loads compiled .vlx/.fas files.
Which ZWCAD edition do I need for the APIs? LISP and scripts work in every full edition. VBA, ZRX and the .NET API come with ZWCAD Professional and MFG (see the edition comparison). SDKs and documentation are available from ZWSOFT’s developer page.
Can AI write a large drawing-management application for me? It can draft one, but the risk grows with size. Split the job into small independent commands, verify each, then combine — or move to .NET with a developer once you pass a few hundred lines.
How do I auto-load my LISP tools for the whole team?
Use APPLOAD → Startup Suite on each workstation, or deploy a shared network folder referenced in the support file search path. We set this up for customers during licensed deployments.
Get ZWCAD with hands-on automation support
Customers who license ZWCAD through ZWCAD Vietnam get installation, automation consulting and LISP review included. See our pricing, download the 30-day full trial or contact the technical team — hotline +84 977 893 681 (Zalo/phone).
Compiled from the ZWSOFT documentation linked below. Test sample code on copies of drawings before use.
References:
- ZWSOFT — ZWCAD Developer Documentation (LISP, VBA, ZRX, .NET): zwsoft.com/support/zwcad-devdoc
- ZWSOFT — ZWCAD LISP FAQ 2025 (PDF): dl.zwsoft.com/support/ZWCAD/2025/LISP/Migration_Manual/ZWCAD_Lisp_FAQ_enu_2025.pdf
- ZWSOFT — ZWCAD 2026 Beta announcement: zwsoft.com/news/products/zwcad-2026-beta-now-available
- IMAGINiT — Using ChatGPT to Write AutoLISP Routines: resources.imaginit.com/support-blog/using-chatgpt-to-write-autolisp-routines-for-autocad-and-civil-3d