AutoCAD-CLI

Draw 2D geometry, insert blocks and update attributes or layers by persistent Handle

Safe live editing over late-bound COM. Address every entity by permanent DWG `Handle` (`HandleToObject`), never fragile collection indices. Every write previews first in dry-run mode and wraps `--apply` edits inside `StartUndoMark()` / `EndUndoMark()` for clean rollback.

4 of the 91 verbs · Windows x64 · Offline DXF + accoreconsole.exe + Late-bound COM

cad set-attr [--handle ATTRIB_OR_INSERT_H] [--block NAME] [--tag TAG] --value VAL [--layout NAME] [--file FILE] [--expect FILE] [--apply] [--confirm]
Updates live block attribute(s) by persistent hex attribHandle or insertHandle (+ --tag) or --block + --tag inside an UndoMark (Ring 1A)
cad set-layer [--handle H] [--from-layer L] [--type T] --layer TARGET [--create-layer] [--color N] [--layout NAME] [--file FILE] [--expect FILE] [--apply] [--confirm]
Reassigns live entity layer(s) by persistent hex Handle, --from-layer, or --type inside an UndoMark (Ring 1A)
cad draw --kind KIND [--from P] [--to P] [--center P] [--radius R] [--start-deg A] [--end-deg B] [--points PTS] [--closed] [--width W] [--height H] [--text T] [--layer L] [--layout NAME] [--file FILE] [--expect FILE] [--headless] [--out FILE] [--acad PATH] [--timeout N] [--apply] [--confirm]
Creates a 2D entity (line, circle, arc, lwpolyline, rect, text, point) in live ModelSpace using strict double[3] / flat double[2*N] marshalling inside an UndoMark (Ring 1A)
cad insert-block --block NAME [--at P] [--scale S] [--rotation DEG] [--layer L] [--attrs K=V] [--layout NAME] [--file FILE] [--expect FILE] [--apply] [--confirm]
Inserts a block reference in live ModelSpace (converting --rotation degrees to radians) and optionally populates --attrs TAG=VAL,TAG2=VAL2 inside an UndoMark (Ring 1A)

Common questions

What happens if a live edit fails halfway through?

Write verbs (cad set-attr, cad set-layer, cad draw, cad insert-block) wrap mutations inside StartUndoMark() / EndUndoMark() so AutoCAD Undo cleanly reverts the operation, and all writes default to a dry run until --apply is passed.

Can I insert a title block or electrical symbol with attributes in one command?

Yes. cad insert-block inserts a named block at --at X,Y, converts --rotation degrees to radians automatically, and populates --attrs TAG=VALUE,TAG2=VALUE2 in a single UndoMark.

Run these verbs on your own DWG and DXF drawings

Every verb above returns structured JSON and takes plain command-line flags. AutoCAD-CLI is local and on-premise: zero UAC elevation, zero Autodesk DLLs redistributed, and every write is a dry run until you pass --apply. Fourteen-day free trial with corporate e-mail, no card.

Start a 14-day free trial

Other verb families