Skip to main content
Glama
AutoCAD MCP Pro
by U-C4N

AutoCAD MCP Pro

Production-grade AutoCAD automation for AI agents. Live through COM on Windows, or headless through ezdxf anywhere — one typed contract, two engines.

X: @UEdizaslan Discord CI PyPI Downloads Python 3.11+ License: MIT

Install · What's new · Gallery · Tools · Engines · Verification · Evidence · Limits · Config · Changelog

v1.8 release snapshot: 257 tools · 13 resources · 5 prompt templates · 7583 collected tests. 257 is the registered count. Since 1.8.0 a default install lists six over tools/list (DISCOVERY_MODE=search: search_tools, describe_tool, call_tool and the three DISCOVERY_PINNED tools), and every tool the profile and packs allow stays callable by name; DISCOVERY_MODE=off lists 253: the 252 a default profile enables (ENABLE_3D unset hides the five solids) plus describe_tool. system_about is the runtime authority.

What's new in 1.8

1.7 made what the server draws provable. 1.8.0 makes it remember, finish a job in one call and measure itself honestly (design). The new tools are entity_modify_where, layer_rename, layer_merge, checkpoint_create, checkpoint_list, checkpoint_restore, drawing_history, mech_part_revise and pid_project, and the new resources autocad://critique/focuses and autocad://pid/project/last; the counts are in the release snapshot above, and system_about is the authority.

What 1.8.0 adds

It remembers

The operation journal is durable by default (sqlite in ACADMCP_STATE_DIR): a reopened file continues its document_id and revision, a client operation id replays after a restart, and headless drawing_undo steps back to the newest checkpoint, also after a restart. checkpoint_create / checkpoint_list / checkpoint_restore keep stored states; live, mode="in_place" is refused with capability checkpoint_restore_in_place and new_document opens the checkpoint instead. drawing_history finds the value a drawing had in round 2 in two calls after a restart. Every headless DXF write is atomic, and drawing_open(path, recover=True) reads a damaged DXF into a new lineage whose source is protected (recovered_source_protected)

One call, not hundreds

entity_modify_where is QSELECT + CHPROP with a dry run, layer_rename renames every reference, layer_merge is LAYMRG, and dimension_auto(selector=...) dimensions a whole part. Measured task cells: a layer clean-up in 2 calls (1.7.0: 124) and a plate's dimensions in 2 (1.7.0: 89). A cad_batch that writes is all or nothing by default, and a literal handle that names no entity refuses the whole batch before anything runs (unknown_handle)

Six tools listed, every tool callable

DISCOVERY_MODE=search is the default: search_tools, describe_tool, call_tool and the pinned cad_batch, drawing_info and entity_list cost 1,026 prompt tokens idle, against 59,138 for the full DISCOVERY_MODE=off list. A description over 800 characters is listed short, with Details: describe_tool.; the whole text is one call away (table below)

One error envelope

Every error on every route is {ok: false, kind, category, retryable, hint, operation_id, ...}, typed by exception class and never by message text; the text content is what a 1.7 client read. A missing handle, path, command or file has its own kind (not_found, unknown_handle, file_not_found, ...). A failed drawing_finalize returns its score, blocking rows and qa_coverage, so no second QA read is needed

QA that names what it did not check

Every critique lane writes checked or not_checked with a reason, and qa_coverage carries them into finalize, delivery and the manifest. The dimension_truth focus judges a dimension by the text the sheet really shows (dim_override_disagrees, dim_render_stale, dim_value_hidden, ...), and property_override reports entities that override their layer. A lineweight of -3 is Default, never ByLayer. With summary=True a 500-issue critique is answered in 735 characters

Parts revised, P&IDs as projects

mech_part_revise changes a drawn part by its parameters and rebuilds its views in place, keeping its handles; a hand edit refuses it (hand_edited_tagged_entity), and a part drawn before 1.8.0 is model_drift until overwrite=True. pid_line_draw(route="avoid") goes round the symbols between its ports (no_route, routing_budget_exceeded), checked by the new pid_line_through_symbol focus. pid_project checks off-page links, cross-sheet tags and line continuity over a set of sheet files without modifying any; a .dwg sheet is read only on the live engine and refused headlessly with capability dwg

DWG opens headlessly

drawing_open on a .dwg converts it through the ODA File Converter, then AutoCAD's accoreconsole. With neither it is a typed capability refusal (dwg_read); when every route fails it is dwg_conversion_failed with its attempts[]. A save onto the .dwg is still refused (dwg): save it as .dxf

Narrowed on request

READ_ONLY, TOOL_ALLOWLIST / TOOL_DENYLIST and MAX_TOOL_COST refuse a call before anything runs (policy_refused). A writer takes only its own extensions and never a name AutoCAD or Windows loads (path_refused). The HTTP transport refuses an unknown Origin (403), a foreign Host (421) and a body over 8 MiB (413). system_run_lisp runs an AutoLISP read tier under LISP_POLICY=read (COM only: the headless engine has no LISP)

The live engine draws where it means to

A live seat draws in model space until layout_set_current names a sheet; the tab the operator clicks no longer moves it. system_run_command and live undo / redo wait for the command and can fail command_incomplete. One display refresh per COM job, and entity_batch_create / entity_delete_many run as STA jobs sliced at a quarter of COM_CALL_TIMEOUT. All fourteen live smokes passed for this release (AutoCAD 2026, 1.8.0) at da2d7f6, the tree before the four tracker fixes below, whose live checks are partial: see Live evidence in the changelog

Four tracker reports, fixed the same day

view_screenshot captures the whole AutoCAD window at any display scaling, not the top-left 2/3 at 150 % (#17); page_setup_apply takes the device's full-bleed and expanded media, ISO_full_bleed_A3_(420.00_x_297.00_MM) or bleed="full_bleed" (#18); CAD_LAUNCH=never keeps the live engine to the session you opened, and a launch that never accepts Visible is quit, not left windowless (#19); a live entity_get on a DIMENSION / HATCH reuses one Document.Export for COM_SNAPSHOT_TTL seconds instead of exporting the drawing per call (#20). Issues fixed from the tracker in the changelog says what each one measured

Evidence

Correctness suite 83 / 83 against v1.7.0's 61 / 83, 22 fixed and 0 regressed (ab-v1.7.0-vs-v1.8.0.json). Matrix v9: 47 / 47 attempted tasks of 49 (lisp_read_tier environment_blocked, std_tables_b40 not_run). The full headless suite: 7582 passed, 1 xfailed. The headless performance gate against v1.7.0: ok: true, ratios 0.96 to 1.06 (perf-v1.7.0-vs-v1.8.0.json; the 1.06 is the durable journal, measured). The token budget gate exits 0 (evidence)

One call where 1.7 needed hundreds

drawing_open(path)                                 the journal continues the file's id and revision
entity_modify_where(where, set, dry_run=True)      count, would_change and a preview
cad_batch(steps, expected_revision=...)            all or nothing; a missing handle refuses the batch
dimension_auto(selector={"layer": "GEOMETRY"})     a part dimensioned in one call
drawing_critique(focus=None, summary=True)         compact; qa_coverage names every lane not checked
drawing_history(handle=..., detail="args")         what a value was in round 2, after a restart
checkpoint_restore("cp-3", mode="new_document")    back to a stored state, as its own document

Several defaults changed. Each has a switch back to 1.7.0's behaviour where one exists (DISCOVERY_MODE=off, cad_batch(on_error="stop"), JOURNAL_DURABLE=off, LISP_POLICY=denylist, strict_critique=False, COM_REFRESH_MODE=regen, ...), and the changelog's Breaking at a glance lists every one. Not in 1.8.0: no B40 feature-table row is transcribed (every size is still refused by name), and the native .NET worker is deferred to 1.9.0 by a rule fixed before any measurement (docs/adr/0001-native-worker.md).

Earlier releases, 1.7 and 1.6 included, are in the changelog.

Related MCP server: AutoCAD MCP Pro

What it draws

Not a mockup. Every line on this A3 sheet was drawn by the tools this server exposes — an ISO 5457 frame with zones, involute gear geometry (m6, z24), a DIN 6885 keyed bore, the section A-A cut along the keyway with hatched faces, centre lines, an ISO 128-40 cutting plane, an Ra 1.6 surface-texture symbol, six ISO 129 dimensions with the bore at Ø40 H7 +0.025 / 0 from the ISO 286 tables, an ISO 7200 title block and a revision row — then rendered headlessly by view_render. drawing_critique(focus=None) returns 0 issues and the finalize gate scores it 100 (grade A) over 176 entities. Rebuild it with python scripts/render_readme_showcase.py.

The catalogue, authored in code. 43 ISO 10628-2 / ISA-5.1 symbols: 11 valve bodies × 6 actuators, 6 rotating machines, 4 heat exchangers, 6 parametric vessels, 7 inline items, the instrument bubble in 4 types × 5 locations, 5 line markers and 3 connectors. Every one was placed through pid_symbol_insert's own path. Rebuild it with python scripts/render_pid_catalog.py.

Why this exists

A big MCP server is expensive to be connected to. Listing the whole catalog (DISCOVERY_MODE=off, 253 tools) costs a client 59,138 tokens of prompt payload before it has asked for anything. Since 1.8.0 a default install lists six tools instead - search_tools, describe_tool, call_tool and the three DISCOVERY_PINNED tools - for 1,026 tokens, and every tool stays callable by name.

A drafter searches for FILLET, not entity_fillet. Before the corpus, those command names appeared in no tool name or description. That was df = 0 against a stock index: the tools were not ranked badly, they were absent. The fix was data: an authored corpus of 207 AutoCAD command names and 1,479 distinct synonym phrases covering all 257 registered tools. A test refuses to let a tool exist without one.

Advertised surface

Tools listed

Prompt payload

Wire (tools/list)

1.7.0 prompt payload

1.7.0 wire

DISCOVERY_MODE=search (default since 1.8.0, with the three pins)

6

1,026

1,300

—

—

DISCOVERY_MODE=search, DISCOVERY_PINNED=""

3

220

230

455

503

DISCOVERY_MODE=off (TOOL_PROFILE=full)

253

59,138

78,391

62,471 (243 tools)

89,350

DISCOVERY_MODE=off, TOOL_PACKS=core,mech

207

46,767

62,425

47,955 (198)

69,391

DISCOVERY_MODE=off, TOOL_PACKS=core,arch

204

44,901

60,289

46,679 (196)

67,974

DISCOVERY_MODE=off, TOOL_PACKS=core

192

40,722

55,169

41,902 (184)

61,546

DISCOVERY_MODE=off, TOOL_PROFILE=lean

68

16,182

21,189

17,945 (66)

25,146

Server instructions (the longest text the builder writes)

—

199

199

461

461

NOTE

Measured on the 1.8.0 release tree withpython -m benchmarks.token_suite (idle lane, over the real in-memory server; token-cost.json). The 1.7.0 columns are the v1.7.0 tag measured the same way with this release's lock (benchmarks/token_budget.json, v1.7.0_measured); 1.7.0's own README quoted the wire column on its older lock (89,226 / 61,422 / 25,066 / 503). Tokens are offline ratio estimates, not tokenizer counts, and they are the uncached cost: prompt caching amortises the idle term. The prompt payload is the tools array a client forwards to the model; the wire column is the whole tools/list result, the basis of every figure up to 1.7.0. In off mode the list carries describe_tool too, and a description over 800 characters is listed as its leading paragraphs plus Details: describe_tool., the full text one describe_tool call away. benchmarks/token_suite.py --tokenizer anthropic counts for real.

Install

pip install autocad-mcp-pro     # or: uvx autocad-mcp-pro
autocad-mcp                     # stdio MCP server, backend auto-selected
AUTOCAD_MCP_BACKEND=ezdxf autocad-mcp    # portable DXF engine, no AutoCAD needed
AUTOCAD_MCP_BACKEND=com   autocad-mcp    # live AutoCAD (needs the [com] extra)

Extra

Pulls in

For

(none)

fastmcp, ezdxf, pydantic

Headless DXF on any OS — no rendering

[com]

pywin32, Pillow

Live AutoCAD control + window capture

[pdf]

matplotlib

PDF export and headless PNG, any platform

[office]

openpyxl

XLSX workbooks (takeoffs, data_extract); CSV is always written

[full]

everything above

Development and CI

NOTE

The bare installcannot draw pixels — ezdxf.addons.drawing imports Pillow unconditionally, so every render path needs it. Add [pdf] for images on Linux or macOS.

As a Claude Code plugin

The server and the premium skill install together. The skill teaches the measured workflow: requirements → geometry → verified on the CAD → saved → reopened → delivered.

claude plugin marketplace add U-C4N/Autocad-MCP
claude plugin install autocad-mcp-pro@autocad-mcp

The plugin runs uvx --from "autocad-mcp-pro[com,pdf,office]==1.8.0" autocad-mcp, which is this release at exactly the plugin's version, so it needs uv. Set AUTOCAD_MCP_SOURCE to a checkout (C:/path/to/Autocad-MCP[com,pdf,office]) to run that code instead. The plugin starts the server in search mode (DISCOVERY_MODE=${AUTOCAD_MCP_DISCOVERY:-search}); set AUTOCAD_MCP_DISCOVERY=off for the full catalog. Already running the server yourself? Keep one: turn the plugin's server off in /mcp, or copy .claude/skills/autocad-mcp-premium/ into your .claude/skills/ instead. plugin/README.md has the details.

{
  "mcpServers": {
    "autocad": {
      "command": "autocad-mcp",
      "env": {
        "AUTOCAD_MCP_BACKEND": "auto",
        "ALLOWED_PATHS": "C:\\Users\\you\\Documents\\AutoCAD",
        "TOOL_PROFILE": "full",
        "TOOL_PACKS": "all",
        "DISCOVERY_MODE": "search"
      }
    }
  }
}

It works with Claude Desktop, Cursor, or any stdio MCP host. For HTTP, run autocad-mcp --transport http --port 8000. It binds loopback only, unless remote HTTP is explicitly enabled and a bearer token is set.

What you get

Area

What it does

Drawing lifecycle

create, open (a damaged DXF with drawing_open(recover=True), which reports every fix and protects the source; a DWG headlessly through the ODA File Converter or AutoCAD's accoreconsole), save (atomic headlessly: a checked temporary file renamed over the target), export DXF/PDF, audit (repairs), purge, undo/redo (reporting verified). A reopened file continues its document id and revision; a file changed outside the server says external_change, and one the server ended before saving says lost_since_save

Durability & history

headless, every save, open, new drawing, rollback batch and checkpoint_create(label) keeps a gzip checkpoint in ACADMCP_STATE_DIR; live AutoCAD keeps one only at checkpoint_create, at each transaction_begin and before entity_delete_many / drawing_purge / text_find_replace - not at a save, an open or a new drawing. The headless drawing_undo steps back to it after a restart too (granularity save / batch / label). checkpoint_list / checkpoint_restore(mode="in_place"|"new_document") (an in-place restore is itself undoable; live AutoCAD restores as a new document). drawing_history(label=, handle=, query=, detail=) reads what was done to the drawing, with which arguments, across restarts: label a round with _meta.label or cad_batch(label=), then read its value back in two calls. drawing_diff(old_checkpoint=, new_checkpoint=) compares checkpoints, with feature-payload and dimension-measurement changes

Geometry

lines, arcs, polylines (with bulges), splines, hatches, trim/extend/fillet/chamfer, handle-preserving edits: entity_edit_geometry moves circle, line and arc geometry, rewrites a polyline's points / bulges (the vertex count may change) and moves a TEXT/MTEXT by x / y; entity_edit_text edits content, height, rotation and position

Set-based edits

entity_modify_where(where, set) restyles every entity a filter matches in one call (QSELECT + CHPROP: layer globs, type, colour, linetype, lineweight, region, block); dry_run returns the count, the first 20 handles and a preview, and an expect_count the drawing no longer matches is refused stale_revision. layer_rename renames a layer and every reference to it; layer_merge (LAYMRG) moves the sources' entities in model space, every sheet and every block definition onto a target and names the block definitions it touched. Entities on locked layers are skipped and reported

Annotation

ISO 129 toleranced dimensions, ISO 286 fits (fit="H7", interference shafts r/s/t/u included), TABLE, MLEADER, GD&T frames and datums (ISO 1101). dimension_auto(selector={"layer": "GEOMETRY"}) dimensions a whole part in one call - polyline edges per side, hole diameters, arc radii, the overall size - with include, group_equal (6× Ø11), skip_existing (on by default: a rerun draws nothing) and dry_run; whatever it cannot dimension is listed in omitted with its reason. A headless dimstyle_modify redraws the dimensions using the style (rerender=False leaves them stale, as 1.7 did)

Engineering generators

involute gears (front + section A-A), DIN 6885 keyed bores, ISO A3 title block

Mechanical parts

one part model (segments or outline + typed features) and one view engine: front / side / top / section / detail with hidden lines, ISO 128-50 cut faces and ISO 129 dimensions. ISO 4014/4017/4032/7089/4762 fasteners and ISO 15 bearings insert as real blocks with attributes. mech_part_revise(part_id, changes) changes a drawn part's parameters by path ({"features.bore.diameter": 24}) and rebuilds its views in place, keeping the handles of the lines, circles and arcs it edits; a hand-edited tagged entity or a part drawn before 1.8.0 is refused unless overwrite=True, and each revision joins a model history that travels with the file (mech_part_inspect(history=True, param=...), drift=True for what no longer matches the model). DIN 471/472, DIN 509, DIN 332 and ISO 3601-2 features have their drawing code and, since 1.8.0, a double-entry transcription pipeline, but their tables still ship empty (see limits). Also ISO 21920-1 surface texture, ISO 2553 welds and ISO 128-40 section lines

Sheet & delivery

ISO 5457 frames A4-A0 with zones and trim marks, ISO 7200 title blocks for every size, revision blocks with clouds, ISO 7573 parts lists with ISO 6433 balloons linked by XDATA, CSV/XLSX extraction, xrefs and images on both engines, real .dwg on a live seat

Architecture

one plan model (walls with hosted doors and windows) and one engine that resolves L / T / X junctions, cuts openings and draws poché by material. Room areas are measured from the faces the walls enclose, never typed, and rooms are read back from any plan with a confidence. Door / window / room schedules are real TABLEs. Also a furniture and sanitary catalogue at nominal sizes, a structural grid, north arrow, section / level / elevation marks, exterior dimension chains, and English or Turkish labels (lang="tr", decimal comma)

Understanding & takeoffs

drawing_understand reads a drawing somebody else made in one call: declared vs inferred units, robust extents and the outlier behind them, plan copies, each layer's discipline and service in five languages, tags, rooms. drawing_scale_check says whether a P&ID is to scale against its layout. pipe_takeoff / cable_takeoff take the topology from the P&ID and the lengths from the layout (rectilinear MST, statuses A/B/C, power never invented) into a Turkish / English / Russian workbook. drawing_diff compares revisions; drawing_topology_check finds dangling ends, near misses and crossings

P&ID

catalogue blocks with ports and tags (ISO 10628-2 / ISA-5.1), port-to-port lines with ISA-5.1 classes and line numbers, pid_graph reads any P&ID back with confidence, instrument index / line list / equipment list, pid_from_spec one-call sheets. An avoid line (pid_line_draw(route="avoid", clearance=, keep_out=), pid_from_spec's sheet.routing: "avoid") goes round the vessels between its ports, and obstacle_hits / the pid_line_through_symbol focus say when a line does not. pid_project checks a project of several sheet files without modifying any: off-page links matched across files, cross-sheet duplicate tags, line-number continuity, and the three lists merged with a sheet column (last result: autocad://pid/project/last)

Styles & standards

ISO-25 / ANSI dimension styles, ISOCP / ROMANS text styles, ISO / ANSI leader styles from authored presets; drawing_apply_standard("iso") sets all of it plus units and the mech layers in one call; changed reports only what moved

Discovery

the default since 1.8.0 (DISCOVERY_MODE=search): a client lists search_tools, describe_tool, call_tool and the DISCOVERY_PINNED tools (cad_batch, drawing_info, entity_list), and can still call every tool by name. search_tools is ranked over an AutoCAD command and synonym corpus — FILLET, BPOLY, QSELECT, WBLOCK, OVERKILL, CHSPACE each rank #1 among the 252 tools a default install searches (the v9 tool_discovery task); describe_tool returns one hit's full input schema, risk, pack and its docstring's own examples, or up to 25 with names=[...]. The server instructions name only the tools the client can see and teach batching first

Batching

cad_batch runs a step list in one round trip and, since 1.8.0, is all or nothing by default (on_error="auto": a batch that writes is rolled back on a failure; on_error="stop" keeps the steps before it). A literal handle that names no entity refuses the whole batch before anything runs (unknown_handle); the result carries changes {added, deleted, counts} and label= names it in the history. entity_delete_many deletes all of its handles or none. fields= projects 11 result-heavy tools

Paper space

tab lifecycle, viewports, entity_change_space (CHSPACE), drawing_export_pdf(layout=…)

Page setup & templates

ISO 216 / ANSI Y14.1 sheets, ctb catalog, page_setup_apply on both engines (paper also takes a canonical media name exactly as AutoCAD spells it, e.g. ISO_full_bleed_A3_(420.00_x_297.00_MM), or a catalogue paper with bleed="full_bleed" / "expand"; the name's numbers fix the sheet size and orientation, a contradicting orientation is refused, and on a live seat a media the device does not list in GetCanonicalMediaNames() is refused with its three closest names, #18), and batch_plot with every sheet size read back from its PDF's /MediaBox. Five bundled templates, built by the server's own tools and pinned reproducible: drawing_new(template="iso_a3_mech"), iso_a1_arch, iso_a3_pid, ansi_b_mech, ansi_d_arch. Save any drawing as a template (.dwt on live AutoCAD; dwt_write refused headlessly)

Environment

several open documents headlessly, portable layer states (ACADMCP_LAYERSTATES XRECORDs — in the file, not in AutoCAD's Layer States Manager), named views, UCS (tool coordinates stay WCS), a system-variable catalog with ranges, document properties. On a live seat: launch/attach, preferences, and an operator prompt / pick / select, where ESC is cancelled, not an error

Selection

window vs crossing stated back to the caller; a polygon tested against its own shape, not its bounding box

Boundaries

boundary_trace (BOUNDARY/BPOLY) chains loose edges into one closed polyline, arcs kept as bulges (headless)

Measurement

analysis_measure_entity measures what is in the drawing, by handle

Hatch depth

gradients, in-place edits, typed edge boundaries (headless), island styles

Annotation objects

WIPEOUT, REVCLOUD, MTEXT background masks (headless), text find/replace

3D solids

solid_box/cylinder/extrude/revolve/boolean on live AutoCAD (ENABLE_3D=true)

Quality loop

drawing_preflight → drawing_plan → drawing_critique → drawing_refine → drawing_finalize (0–100 score); the general focuses (iso128, layer_color, dim_overlap, untrimmed_corner, duplicate_entities, construction_left, property_override (an entity on an engineering layer that overrides the layer's lineweight, colour or linetype; drawing_refine sets it back to ByLayer), dimension_truth (a DIMENSION whose override, DIMLFAC, rendered block, group 42, prefix or visibility disagrees with its geometry or its style; drawing_refine redraws a stale block and leaves the lies to a person), gdt) plus 20 domain critique focuses (P&ID 7 - with pid_line_through_symbol, a line through a symbol that is not its end - mechanical 7 - with model_drift, a drawn part whose tagged entities or views no longer match its stored model - architecture 3, topology 3), each silent on a drawing outside its domain; autocad://critique/focuses lists every one with what it reports. Every check reads every entity of every space, and a check that fails says so. Every check also says what it looked at: drawing_critique(report=True) returns the coverage per layout, and drawing_finalize / drawing_deliver carry qa_coverage, naming each lane that was not checked and why (no_viewport_scale, engine_live_document_template, ...); strict_critique=True fails on those. drawing_critique, validation_check and drawing_topology_check take summary / limit and answer {total, by_focus, by_severity, issues[:limit]}, total always complete. A failed drawing_finalize returns its score and blocking rows (detail="full" for all of them)

Verification

drawing_verify_requirements binds typed source requirements to the real features (handle, feature tag, geometry or DIMENSION) and measures them on the drawing or on a saved file: distance, radius, diameter, angle, concentric, parallel, perpendicular, tangent, counts and absence, each pass / fail / unknown / unsupported / ambiguous with its evidence, as JSON or Markdown. The set can be stored in the drawing itself

Delivery

drawing_deliver: DXF/PDF/PNG + SHA-256 manifest, reopen parity against a second export over every space and block definition (its scope says what that can and cannot see), and with requirements= every requirement measured again on the reopened file; the open document is never re-pointed at the export

Safe edits

documents carry an id and a content revision; cad_batch / drawing_refine / text_find_replace / pid_from_spec preview exactly and apply only against an unchanged revision; a client operation id replays a retried call instead of repeating it, also after a restart (the journal is durable, in ACADMCP_STATE_DIR)

Errors

every failure on every route is one typed envelope: {ok: false, kind, category, retryable, hint, tool, backend, operation_id, message} beside the unchanged sentence. retryable is true only when nothing was written; a refused raw command lists the typed tools that do the same job (alternatives)

Security

READ_ONLY, TOOL_ALLOWLIST / TOOL_DENYLIST and MAX_TOOL_COST narrow what a client may reach: a refused tool is not advertised, and a call to it - direct, through call_tool, or as a cad_batch step - is refused policy_refused before anything runs (system_status.policy says what is in force). Every writer accepts only its own extensions and none writes a file AutoCAD or Windows loads (acad*.lsp, .fas, .scr, .dll, acad.pgp, ...), even inside ALLOWED_PATHS. Over HTTP, an unknown Origin is 403, a foreign Host 421, a body over 8 MiB 413, tokens are compared in constant time, and MCP_AUTH_TOKEN_READONLY issues a read-only token. system_run_lisp runs the AutoLISP read tier (vla-get-*, entget, mapcar over a lambda, ...) under LISP_POLICY=read, and refuses the rest with symbol, line, column and the typed alternatives

Session metrics

system_status(metrics=True) reports this connection's calls, by_tool, result_bytes, errors_by_kind and p50 / p95 ms, and on a live seat each COM job's queue / guard / work / refresh / counter ms; off by default. system_status.operations is a short summary ({count, last, unknown_commit}); drawing_history lists the calls

Live speed

the live engine refreshes the display once per COM job (Update() of the entity for a single create, one Regen otherwise; COM_REFRESH_MODE=regen for a seat where Update() does not paint), entity_batch_create / entity_delete_many run as one STA job sliced inside COM_CALL_TIMEOUT, and the corner operations read only the target block's new entities. benchmarks/perf_com.py measures it against v1.7.0 on a live seat: on AutoCAD 2026 three of its four targets are missed (see What this release is bad at)

257 tools in 28 groups. TOOL_PACKS=core hides these from a client that needs none of them: the ten pid_* tools, the 22 environment tools, the 15 mechanical tools, the 12 architectural tools and the two plant takeoffs. TOOL_PACKS=core,mech keeps the mechanical ones, TOOL_PACKS=core,arch the architectural ones, and TOOL_PACKS=core,plant the takeoffs. There are also 13 resources that cost nothing in the tool budget (autocad://drawing/info, layers, blocks, entities/stats, entities/{layer_name}, system/status, pid/symbols, pid/project/last, standards/isa51, standards/coverage, critique/focuses, and the task recipes recipes/index and recipes/{recipe_id} - seven recipes, among them layer_cleanup and dimension_part, each one cad_batch) and 5 prompt templates.

Three rules worth knowing.

  • Every coordinate in and out of a tool is WCS on both engines. The one exception is TEXT rotation, which stays in the entity frame: a mirrored TEXT is mirror-imaged, and no scalar angle expresses that.

  • Never read vertices back and shoelace them. That silently loses 28.2% of the area on a semicircular edge. analysis_measure_entity(handle) reads the real geometry and states its own accuracy.

  • A lineweight of -3 is Default (the LWDEFAULT setting), not ByLayer: ByLayer is -1 and ByBlock -2. Every lineweight input also takes the names "ByLayer", "ByBlock" and "Default", a layer refuses ByLayer and ByBlock by name, and entity rows carry lineweight_name.

The two engines

One contract across 23 modules in backends/contracts/. @capability(key, reason=…) supplies a default that refuses, and a test holds both backends' capability key sets equal. There are 45 capability keys. Read system_capabilities at runtime rather than trusting the table: several depend on what the machine has installed (matplotlib, openpyxl, the ODA File Converter).

Capability

COM (live AutoCAD)

ezdxf (headless)

Live document control

✅

—

Cross-platform, no AutoCAD

—

✅

Transactions and rollback

✅

✅

Paper-space layouts + viewports

✅

✅

Viewport model-content rendering

✅

✅ ᵐ (no borders)

Selection window / crossing / polygon

✅

✅

Entity area by handle

ActiveX .Area

Analytic, bulges included

HATCH filled area (islands subtracted)

AutoCAD's own number

Loops walked, hatch_style reported

HATCH loops and DIMENSION fields in entity_get

✅ read from a Document.Export snapshot, which costs about as much as drawing_understand on a large drawing and is reused for COM_SNAPSHOT_TTL seconds (default 5) while the document's revision and operator-edit count stand still, so N reads of an unchanged drawing cost one export; an entity missing from the reused export is read from a fresh one; system_status.snapshot_reuse counts exports and reuses (#20)

✅

A session bound to its document

✅ an active-tab switch is refused, view_screenshot included; a restarted AutoCAD is a new document (application_changed); the operator's object edits move the revision

— only the server switches documents

Where new geometry goes

model space until layout_set_current names a sheet; the layout tab the operator clicks never moves it

model space until layout_set_current

Raw commands

system_run_command waits for the command (COMMAND_DEADLINE_S) and reports created entities and last_prompt; a command left at a prompt is command_incomplete

— refused by name

REGION / 3DSOLID area

✅

— ACIS is opaque to ezdxf

3D solids

✅ with ENABLE_3D=true

—

DWG read

✅ native

drawing_open converts it through the ODA File Converter, then AutoCAD's accoreconsole (ACCORECONSOLE_PATH), if installed; otherwise refused dwg_read. The opened drawing is saved as .dxf

DWG write

✅ SaveAs

via the ODA File Converter, if installed

.dwt templates

✅

DXF only — dwt_write refuses

Reading a foreign drawing (drawing_understand, takeoffs)

✅ one Document.Export snapshot; the document is never renamed

✅

XLSX workbooks

✅ ᵒ

✅ ᵒ

Preferences · launch · operator prompts

✅

— refused by name

WIPEOUT · MTEXT background colour

— verified absent, AutoCAD 2026

✅

REVCLOUD · BPOLY · typed hatch edges

— no ActiveX member

✅

CHSPACE

— unverified on a live seat

✅ ᶜ

Undo history

✅ AutoCAD's own; a checkpoint restores as a new document (checkpoint_restore_in_place refused)

durable checkpoints, also after a restart; per-call steps opt-in with EZDXF_UNDO_DEPTH

TABLE and MLEADER

Native

Portable composite

Screenshots and PDF

Window capture, DPI-aware: the server makes itself DPI-aware before reading AutoCAD's window rectangle, so the whole window is captured at any Windows display scaling, and the report states dpi, capture (physical pixels) and window_minimized (#17)

Matplotlib ᵐ

A region screenshot (view_screenshot(region=[x0, y0, x1, y1], max_px=))

✅ the Document.Export snapshot drawn by the headless renderer (source: "export_snapshot")

✅ ᵐ

ᵐ Needs matplotlib ([pdf]/[full]). Without it, png, pdf, viewport_render and handle_overlay report unsupported headlessly. ᵒ Needs openpyxl ([office]/[full]). Without it, XLSX is refused with xlsx_write and CSV is still written. ᶜ Headless CHSPACE has four restrictions, named in its capability reason: top-view untwisted viewports only; dimensions refused unless frozen; ACIS, proxy and table entities refused; viewport clipping reported rather than applied.

IMPORTANT

The COM paths run against alive AutoCAD 2026 through eight asserting smoke scripts (scripts/smoke_*_com.py) on one harness (scripts/live/harness.py: attach only, its own documents, an active-document guard). The 1.7.0 runs passed 129 / 129 checks on the close-out commit 13499fe; their JSON is committed under benchmarks/results/live/. These runs catch what no headless test can: ActiveX refuses entity.Layer on a missing layer where ezdxf quietly creates it, calls a block reference BLOCKREFERENCE rather than INSERT, and, once pywin32's type-library cache exists, hands every listed entity back as a bare IAcadEntity with no endpoints. Each of those broke a tool that passed every headless test.

The verification workflow

drawing_preflight(intent, requirements)        typed items: id, quantity, target + unit, feature, source
drawing_plan(..., persist_requirements=True)   the set travels inside the DWG/DXF
mech_part_draw(spec)                           every entity tagged with its feature
drawing_verify_requirements(use_stored=True)   measured on the document: pass / fail / unknown / ambiguous
drawing_critique(focus=None)                   drafting checks over every entity of every space
drawing_deliver(..., requirements=...)         exported, reopened, measured again on the file
drawing_verify_requirements(manifest_path=)    later: has anything in the delivery changed since?

A drafting score is not an acceptance. drawing_finalize still returns its 0–100 score, but with requirements= a requirement that does not pass blocks it (failed_acceptance), whatever the score.

Evidence

Every number here is produced by a script under benchmarks/ and published as JSON under benchmarks/results/published/; benchmarks/README.md explains each lane and keeps the full tables.

83 deterministic headless checks run against the previous tag and the current tree, each in its own subprocess:

Version

Checks passing

Pass rate

Fixed

Regressed

v1.7.0 (baseline)

61 / 83

73.5 %

—

—

v1.8.0 (this release)

83 / 83

100 %

22

0

The task matrix v9 (49 tasks, each one able to fail) passes 47 / 47 of the tasks the headless engine attempts (lanes-v9/); the headless performance gate against v1.7.0 is ok: true with ratios 0.96 to 1.06, the 1.06 being the durable journal's one commit per mutating call (perf-v1.7.0-vs-v1.8.0.json); the token budget gate exits 0 (token-cost.json); and all fourteen live smokes passed on AutoCAD 2026 for this release at da2d7f6, before the four tracker fixes (matrix.json). What was measured and found wanting is in the changelog's Live evidence and under the limits below.

What this release is bad at

A page that only lists strengths is a page that has not been measured.

Headless entity creation is slower than v1.4.0, and neither 1.6, 1.7 nor 1.8 won it back. 1.8.0 is not slower than 1.7.0 beyond the gate's noise, and 1.7.0 not slower than 1.6.0 (measured); the loss is 1.6's against v1.4.0, and winning it back is B10, 1.8.1. 1.8.0 adds two measured costs of its own on that path, both named above: the durable journal's commit on every mutating call, and the atomic save's fsync and verification. These are medians of five alternating runs on one machine, with one interpreter (CPython 3.11.15) and one ezdxf, v1.4.0's code against 1.6.0's (perf-v1.4.0-vs-v1.6.0.json):

Workload

v1.4.0

v1.6.0

v1.6.0, EZDXF_CALL_TIMEOUT=0

2,000 lines, one call each

244.5 ms

306.1 ms (1.25×)

284.9 ms (1.17×)

10,000 lines: build, DXF export, reopen

1,847.9 ms

2,553.5 ms (1.38×)

2,216.4 ms (1.20×)

Region query over 10,000 entities

665.2 ms

712.2 ms (1.07×)

783.9 ms (1.18×)

Premium quality pass

150.6 ms

65.3 ms (2.3× faster)

69.9 ms

The per-call timeout stops one hung call from wedging a server whose document lock is a single asyncio.Lock. It explains only part of the slowdown: switched off, creation is still 1.17× and 1.20× slower. The rest is extra work per call that 1.6 has not removed. A cProfile of the event-loop thread counts 491,071 function calls for the 2,000 creates, against v1.4.0's 319,038. Earlier READMEs said that switching the timeout off returned creation to v1.4.0's numbers. Measured this way, it does not. The region-query row, which moves the wrong way, shows this machine's noise floor (about ±10 %). Roadmap criterion 7 is not met and moves to 1.7.1.

Four mechanical feature tables ship empty. DIN 471/472 retaining-ring grooves, DIN 509 undercuts, DIN 332 centre holes and ISO 3601-2 O-ring grooves have their drawing code and their provenance tests, but no rows. A groove diameter written from memory is a wrong workshop drawing, while a narrow table is merely narrow. So every size is refused by name until rows verified against the standard's own table are transcribed. Since 1.8.0 a row reaches the tables only through a double entry: typed twice into engineering/mech/standards/data/<std>.a.json and .b.json by two named people, with the edition, table and page, checked against physical invariants and generated into _rows.py by scripts/build_standards.py (--check is a gate). ISO 3601-2 is now two tables, radial static and axial, so the eight tables are DIN 471, DIN 472, DIN 509-E, DIN 509-F, DIN 332-A, DIN 332-B, ISO 3601-2 and ISO 3601-2-axial. The licensed copies were not at hand for 1.8.0, so every one of them is still empty and deferred to 1.8.1 by name.

Undo after a restart is as fine-grained as your checkpoints. Headless, a checkpoint is taken at a save, an open, a new drawing, a rollback batch or a transaction boundary, and at checkpoint_create - never per call - so drawing_undo after a restart steps back to the last of those, not one call. Label a point you may want back with checkpoint_create(label). Redo across a restart is not kept. On a live seat a checkpoint is a Document.Export, taken only at checkpoint_create, at each transaction_begin and before entity_delete_many / drawing_purge / text_find_replace - not at a save, an open or a new drawing - and it restores only as a new document. Without a state folder (JOURNAL_DURABLE=off) there are no checkpoints.

A part revision refuses what it cannot rebuild. mech_part_revise refuses a part with a detail view or two views sharing a view tag, and over a hand edit of a tagged entity or a part drawn before 1.8.0 unless overwrite=True - which replaces the hand edit with the model. Reconciling a revision with a changed spec, and keeping a hand edit, are 1.8.1. Dimension handles change on every revision. A part drawn before 1.8.0 is an unstamped info issue of the model_drift focus until it is revised.

The live speed-ups miss three of their four targets. One display refresh per COM job, bulk tools as one sliced job and owner-block reads for the corner operations are in 1.8.0, and benchmarks/perf_com.py measured them against v1.7.0 with targets fixed in advance (AutoCAD 2026, 1.8.0): entity_batch_create(200) is 2.9× faster than 200 single creates and entity_delete_many(200) 3.8× faster than 200 single deletes, against a target of 5× each; the single entity_create_circle median is 8.9 % lower, against 30 %; and the fillet time at 10,000 lines against 5,000, whose target is at most 1.2×, varies between runs on that seat (55× in the committed run, 1.19× in a run an hour earlier). A 1.8.0 fillet is still 4× to 200× faster than 1.7.0's (perf_com.json). The native .NET worker is deferred to 1.9.0 under a rule written before any measurement (ADR 0001).

Takeoffs are estimates, and they say so.

  • A layout length is the rectilinear minimum spanning tree of the tags a run connects, plus a stated vertical allowance, and it is labelled an estimate.

  • A P&ID length is used only when drawing_scale_check calls the P&ID to scale.

  • A power the P&ID does not state stays empty and becomes an open item, and no cable-section table is authored: a section comes only from your section_rules.

  • Where no callout names a panel, the nearest panel is inferred and flagged.

  • Detail copies of equipment are flagged, and excluded only when you ask.

The readers were tuned on the synthetic plant pair and on one real P&ID / layout pair that is not in this repository. Another drafting office's layer and text conventions may need vocabulary.

Verification measures what it can bind, and says so when it cannot. A requirement is measured on a feature it can identify: by handle, by the feature tag this server's generators write, by an architectural element, by a geometric predicate or by a DIMENSION's defpoints. On somebody else's drawing that usually means a predicate. Two equal candidates are ambiguous, and a spline or a tilted plane is unsupported. Neither is a pass, so a report full of unknown is a report that needs better selectors, not a clean part.

A live revision sees the operator's object edits, not everything. No COM event sink is used (one left the seat refusing Documents.Add()); a transient AutoLISP database reactor in the bound document, read through VL.Application.16, counts object changes, and a change since the server's previous call is one more revision. Measured on AutoCAD 2026: an entity added, moved, re-propertied or deleted, a layer added or changed, ERASE and U each move it by one. A view change and a system variable written with SetVariable do not, an edit made while a server call runs is folded into that call, and without Visual LISP the revision counts this server's writes only (system_status.operator_edits says which). Two counter reads per live call, 0.6-1.2 ms each (median, two runs). Two servers bound to one document each keep their own counter id, so a read by one never moves the other's revision; a write by one is an outside edit to the other. The preview's entity fingerprints still back every apply.

The operation journal is durable, and it writes to disk. Every call's record goes into <ACADMCP_STATE_DIR>/journal.sqlite3 (default %LOCALAPPDATA%\autocad-mcp-pro\state), so a client operation id replays after a restart, and a call that was running when its server died answers requires_reconcile (error_kind: "process_exit"). By default the arguments are kept up to 4,096 bytes; JOURNAL_ARGS=digest keeps only their sha256, and JOURNAL_DURABLE=off restores the in-memory journal. A folder inside a repository checkout or beside drawings is refused, and an unusable store leaves the journal in memory with system_status.state_store.degraded. No call fails because of its journal, but a restart then forgets.

A damaged DXF is recovered only when you ask, and only partly. A file that does not parse is refused by name (damaged_drawing, naming recover=True) and the open document is kept. drawing_open(path, recover=True) reads it with ezdxf.recover, which drops what it cannot parse, not always with a fix entry: read recovered.entities_read before trusting the result. The recovered drawing will not save over the damaged file without drawing_save(overwrite_source=True). A DWG is not recovered (recover_unsupported; use AutoCAD's own RECOVER).

No Plant 3D. The roadmap's track D (read-only queries of a Plant 3D project) was dropped: the maintainer does not use Plant 3D, and a reader tested against nobody's real projects would be a guess. Roadmap criterion 5 is withdrawn, not met.

No REGION or 2D booleans headlessly. add_region() produces a REGION with zero ACIS bytes, and the greiner_hormann substitute loses 28.2% of the area on a square with one semicircular edge.

system_run_command / system_run_lisp are a guardrail, not a security boundary. The rejection message says so in those words. A 36-verb denylist refuses the obvious cases (policy_refused, with the typed tools for the refused verbs in alternatives), but AutoCAD accepts hundreds of commands, and DANGEROUS_COMMANDS_ENABLED=true switches the list off entirely. LISP is narrower: under LISP_POLICY=read (the default) a real reader runs only the AutoLISP read tier and sends everything else to the same denylist, which also re-scans every read-tier verdict; there is no write tier before 1.8.1 (LISP_POLICY=denylist is the 1.7 behaviour, off checks nothing). To take the escape hatches away altogether, TOOL_DENYLIST=system_run_command,system_run_lisp.

Path validation is per-tool, and unscoped until you scope it. With ALLOWED_PATHS empty (the default), the only positive bound is a ten-entry system-directory denylist that does not include C:/Users, /home, /root or /var. Set ALLOWED_PATHS.

Non-AutoCAD ProgIDs are unverified. CAD_PROGID changes which COM application the backend attaches to; nothing beyond the connection has been tested against BricsCAD, ZWCAD or GstarCAD.

The live engine attaches to your session, or starts one. With the default CAD_LAUNCH=auto, the first tool call attaches to a running AutoCAD and starts one when none runs; set CAD_LAUNCH=never to have the server work only in the session you opened, and it answers cad_not_running until you open AutoCAD (#19). The launch path itself - Dispatch, the Visible retry and the Quit of an instance that never comes up - is covered by fake-COM tests and was not exercised on a live seat.

Known limitations of the P&ID track

The default router is orthogonal and blind; avoid sees symbols. pid_line_draw picks auto (still the default) from seven orthogonal candidates, by fewest bends then length:

  • straight;

  • one bend;

  • two bends through the midline;

  • a stub out of each port joined by three bends.

You can also take direct, or pass waypoints. Since 1.8.0, route="avoid" (and pid_from_spec's sheet.routing: "avoid") searches an orthogonal route that keeps clearance from every symbol that is not one of its ends and from every keep_out box; it refuses no_route naming the enclosing symbols' tags, or with on_blocked="cross" runs through as few blocked grid edges as it can (not always the fewest boxes) and lists them in obstacle_hits. Every route counts the existing lines it crosses (crossings); avoid adds a cost for each, but a crossing is allowed, never refused. A dense sheet can exhaust the 50,000-node search (routing_budget_exceeded; pid_line_draw does not expose the budget, so pass waypoints), a line-number label is placed after routing and is only reported when it overlaps a symbol (label_hits), and a per-line avoid inside pid_from_spec is refused.

A foreign drawing is read at the confidence it earns, and no higher. A block this server did not place classifies at 0.6, with inferred ports, by its TAG-style attribute or a keyword in its name. It classifies at 0.3 when a line merely touches it, and a 0.3 guess can neither raise nor suppress a critique finding.

On the live engine, an INSERT turned off a right angle has members ActiveX cannot measure, so it reports an approximate box. pid_graph takes the tighter wall of that box and the attribute-inclusive box on every side. Even so, a line ending on such a body's true edge can still be reported dangling, with the nearest port as the hint. Read stats.confidence_min first.

Projects are read, not written. pid_graph links off-page connectors within one drawing; pid_project (1.8.0) matches them across up to 50 sheet files, finds cross-sheet duplicate tags and line-number breaks, and never modifies a sheet. A project-wide tag sequence, and refusing a tag another sheet already holds, are 1.8.1. LINK ids are compared case-sensitively and tags case-folded. A .dwg sheet is read through the live backend (a headless pid_project refuses it; a headless drawing_open converts one only when ODA or accoreconsole is installed). There is no DEXPI/Proteus export and there are no ISA-5.2 binary-logic symbols in this release. Both cuts are recorded in the spec so nobody re-derives them.

Known limitations of the settings track

Layer states are ours. layer_state_save writes a portable snapshot into an ACADMCP_LAYERSTATES XRECORD. It survives save/reopen on both engines and travels with the DWG/DXF. It is not an AutoCAD LAYERSTATE and does not appear in the Layer States Manager, which is why system_capabilities reports layer_states as mode: "xrecord".

Six of the 22 environment tools need a live seat. Preferences, launching, the operator prompts and the five summary fields of document properties are refused headlessly with preferences / dwgprops / live_application / interactive_prompt. Each is a refusal, not a stub.

A .dwt template is the same case (dwt_write): a .dwt is a DWG container, so headlessly the template is saved as DXF. mleaderstyle_create is not such a case. ActiveX has no MLeaderStyle collection, but the ACAD_MLEADERSTYLE dictionary holds full IAcadMLeaderStyle objects, so both engines create leader styles.

A dimension is redrawn on a style change, a scale and a point edit only. Since 1.8.0, dimstyle_modify redraws every dimension using the style on both engines (rerendered; live through Update() and a read-back of the *D text), and entity_scale and entity_edit_geometry redraw the DIMENSION they change. A move, rotate, mirror, copy or array does not redraw it yet (1.8.1), and neither does a DIMENSION inside a block definition; dimension_truth reports a block that shows another text than its style formats as dim_render_stale. Headless, ezdxf 1.4.4 draws a two-line angular dimension's reflex angle, which that focus reports as not repairable here: redraw it in AutoCAD. The live redraw has not yet been run on a seat.

Known limitations of the architecture track

Nominal, not standard. The furniture and sanitary blocks carry nominal catalogue sizes and say so. The stair tool reports the Blondel relation (2R + G within 600–650 mm) as a design rule, never as a building code. The arch layer colours are a repository convention: ISO 13567 fixes the names, not the colours. Labels speak English or Turkish; any other lang is refused with the list.

Configuration

Nothing loads a .env file — export these, or set them in your MCP client's env block.

Variable

Default

Purpose

AUTOCAD_MCP_BACKEND

auto

auto, com, or ezdxf

CAD_PROGID

AutoCAD.Application

COM ProgID the live backend attaches to

CAD_LAUNCH

auto

Whether the live engine may start the CAD application when none is running: auto attaches, else starts it (and quits an instance it started that never accepts Visible); never attaches only, and the first call and system_launch answer cad_not_running instead. An unknown value stops the server at startup

TOOL_PROFILE

full

lean (67 curated tools, 57 with TOOL_PACKS=core) or full

TOOL_PACKS

all

Vertical packs to advertise: core,pid,settings,mech,arch,plant (core always on)

DISCOVERY_MODE

search

search (the default since 1.8.0) lists search_tools + call_tool + describe_tool and the DISCOVERY_PINNED tools, and every tool stays callable by name; off advertises the full catalog (the 1.7 default). An unknown value falls back to off with a warning

DISCOVERY_PINNED

cad_batch,drawing_info,entity_list

Comma-separated tools search mode lists directly, as shortened cards (full input schema; describe_tool returns the whole description). Empty pins nothing; a pin the profile or packs hide is not listed, an unregistered name is warned about at startup

ENABLE_3D

false

Expose the opt-in solid_* tools (COM)

LOG_LEVEL

INFO

Python logging level

ALLOWED_PATHS

(empty)

Comma-separated absolute paths the server may access

MAX_UNDO_STACK

5

Maximum retained undo snapshots

EZDXF_UNDO_DEPTH

0

Headless per-call undo steps (a full DXF snapshot per mutating call), used before the durable checkpoints; 0 leaves undo to the checkpoints

MAX_DXF_BYTES

536870912

Reject larger DXF input (512 MB); 0 disables

MAX_QA_ENTITIES

2000000

Refuse a QA read (critique, validator, finalize, deliver) of a larger drawing with scan_incomplete; 0 disables, a negative value is refused at startup

MAX_LIST_LIMIT

5000

Bound list/selection response sizes

MAX_SPEC_ITEMS

2000

Items per list of a pid_from_spec / arch_plan_from_spec document; 0 disables

MAX_VESSEL_TRAYS

500

Trays a parametric column may carry; 0 disables

COM_CALL_TIMEOUT

60

Per-call live AutoCAD timeout (s); 0 disables

COM_SNAPSHOT_TTL

5

Seconds a live entity_get on a DIMENSION / HATCH reuses its whole-drawing Document.Export (counted from when the export returned) while the document's revision and operator-edit count stand still; 0 exports on every read

COMMAND_DEADLINE_S

8

How long a command sent to AutoCAD's command line (system_run_command, live undo / redo, corner operations, the transaction mark) may stay active; past it AutoCAD's LASTPROMPT is read, ESC is sent three times and the call fails command_incomplete

COM_REFRESH_UPDATE_MAX

1

A live job that asked for at most this many display refreshes, each naming its entity, calls Update() on the last one; a larger job does one Regen. 0 makes every job Regen

COM_REFRESH_MODE

auto

regen forces one Regen per live job (for a graphics setup where Update() does not paint). An unknown value falls back to auto with a warning

ACCORECONSOLE_PATH

(unset)

The accoreconsole.exe the headless drawing_open converts a .dwg with, after the ODA File Converter. Unset uses AutoCAD 2026's installed console when it exists; off disables the route

ACCORECONSOLE_TIMEOUT_S

60

One DWG -> DXF conversion's deadline (kept inside EZDXF_CALL_TIMEOUT); an overrun kills the console's process tree. Must be a number above 0

EZDXF_CALL_TIMEOUT

120

Per-call headless timeout (s). A read that overruns is never quarantined: until it ends, other calls on its document are refused by name (kind: "busy") while drawing_open / drawing_new / drawing_close / document_activate / document_close and document_list go through without waiting for it — no restart is needed. They do not wait on its lock, but a read that computes holds Python's GIL, so the server answers slowly until it ends: an 8 s CPU-bound read at 1 s gave its own error at 5.1–5.5 s, a busy refusal in 1.2–1.8 s and drawing_new in 0.6–1.3 s (a read that waits on I/O answers in milliseconds). 0 disables the timeout: nothing is quarantined or detached, so a call that never ends keeps the document — every later call, the exits included, queues behind it, and only its end or a restart frees it

SHUTDOWN_GRACE

5

Seconds shutdown waits for a worker still inside a call before exiting without it; 0 does not wait

ACADMCP_STATE_DIR

%LOCALAPPDATA%\autocad-mcp-pro\state ($XDG_STATE_HOME/autocad-mcp-pro elsewhere)

The operation journal, pending-save markers, file lineage, durable checkpoints (docs/<lineage_id>/cp/) and the accoreconsole staging folder. A folder inside a repository checkout or one holding drawings is refused at startup and the journal runs in memory (system_status.state_store.degraded)

JOURNAL_DURABLE

on

off keeps the operation journal in memory only (the 1.7 behaviour: a restart forgets every operation id) and takes no checkpoints: the checkpoint tools are refused checkpoints, and the headless drawing_undo needs EZDXF_UNDO_DEPTH again

JOURNAL_ARGS

bounded

What a journal row keeps of the arguments: bounded (canonical JSON up to 4,096 bytes), digest (sha256 only; answers kept as a hash too) or off

JOURNAL_SYNC

normal

sqlite synchronous: normal loses nothing on a process kill; full also covers an OS crash or power loss, at about 30× the cost per commit

JOURNAL_RETAIN_DAYS

30

Journal rows older than this are dropped when the store opens

JOURNAL_RESULT_MAX_KB

64

A client id's answer above this keeps only its sha256 and replays as result_truncated: true

CHECKPOINT_KEEP

20

Checkpoints kept per drawing lineage besides its first (S0); older ones are evicted (listed with evicted: true, restoring one is refused checkpoint_evicted)

CHECKPOINT_BUDGET_MB

512

The checkpoint disk budget across lineages: the least recently written lineage, oldest checkpoint first, is evicted, never the one just written (so the disk stays at or below the budget plus one checkpoint)

CHECKPOINT_MAX_DOC_MB

32

The most checkpoint bytes one lineage keeps

SAVE_BACKUP

(off)

1 copies the previous file to <name>.bak before a headless save replaces it

READ_ONLY

false

true runs only read tools and writes no file; anything else is refused policy_refused before it runs

TOOL_ALLOWLIST

(empty)

Comma-separated tool names or globs (entity_*); only these are advertised and callable. An entry naming no tool is warned about at startup (system_about.policy.unmatched)

TOOL_DENYLIST

(empty)

Comma-separated tool names or globs that are neither advertised nor callable

MAX_TOOL_COST

escape

The highest tool cost a call may carry: read, safe, mutate, destructive or escape. A file write is mutate whatever its tool is labelled

DANGEROUS_COMMANDS_ENABLED

false

Allow blocked commands/LISP; reported as unsafe mode

LISP_POLICY

read

How system_run_lisp checks an expression (live only): read runs the AutoLISP read tier and sends the rest to the 1.7 denylist, denylist is the 1.7 behaviour, off checks nothing. An unknown value falls back to read with a warning

ALLOW_REMOTE_HTTP

false

Permit a non-loopback HTTP bind (which also needs a token and ALLOWED_PATHS)

MCP_AUTH_TOKEN

(empty)

Bearer token required for remote HTTP; scopes mcp:read and mcp:write

MCP_AUTH_TOKEN_READONLY

(empty)

A second bearer token with only mcp:read: its requests run under the read ceiling and see only read tools. Alone it also enables auth

HTTP_ALLOWED_ORIGINS

(empty)

Origins an HTTP request may carry; any other Origin is refused 403. A browser-based MCP inspector needs its own origin listed (e.g. http://localhost:6274); * allows all

HTTP_ALLOWED_HOSTS

(empty)

Host headers accepted besides the bound host:port and the loopback names; any other is refused 421. * allows all

MAX_HTTP_BODY_BYTES

8388608

An HTTP request body over this (8 MiB) is refused 413, counted on chunked bodies too; 0 disables

Architecture

The diagram under The two engines is the call path; the typed contract is 23 modules under backends/contracts/ with 45 capability keys held equal on both engines.

The sequence in scripts/render_readme_showcase.py, which produced the gear sheet:

drawing_new() + drawing_plan(...)                ISO linetypes + layers bootstrapped, the plan on record
drawing_apply_iso_layers("mech")                 ISO 128 lineweights per layer
dimstyle_create("ISO-35", ...)                   3.5 mm text and arrows for an A3 sheet
sheet_frame(size="A3")                           ISO 5457 frame with zones

gear_draw_spur_front_view(                       involute flanks, not a decorated circle
    module=6, teeth=24, bore_diameter=40,
    keyway_width=12, keyway_depth=3.3)
gear_draw_section_aa(face_width=46)              then cut along the keyway, faces hatched (hatch_material)
centre_marks(...) + section_line(...)            centre lines, the A-A cutting plane

dimension_linear(...) x5                         ISO 129: pitch Ø144, tip Ø156, face 46, keyway 12 and 43.3
dimension_diameter(..., fit="H7")                Ø40 H7 +0.025 / 0 from the authored ISO 286 tables
surface_texture(..., ra=1.6)                     on the bore
titleblock_apply(title="SPUR GEAR m6 z24", material="C45E", ...) + a revision row

drawing_critique(focus=None)                     -> []  must be empty before finalize
view_render(max_px=3200)                         -> PNG

The full production loop adds drawing_preflight and drawing_plan at the front, drawing_refine after the critique, and layout_create + viewport_create + drawing_deliver at the end.

Development

uv sync --locked --all-extras
uv run pytest
uv run ruff check . && uv run ruff format --check .

uv.lock pins the whole transitive graph, so this reproduces CI exactly. CI runs Linux (3.11 / 3.12) and Windows (mocked COM), plus package, Docker and MCP-registry jobs. It also runs claude plugin validate --strict on the marketplace and the plugin, the generated-file gates (build_plugin.py --check, generate_tool_inventory.py --check, check_doc_numbers.py), the token-budget job (python -m benchmarks.token_suite --lanes idle,task --budget benchmarks/token_budget.json and python -m benchmarks.call_budget: a ci-gated ceiling breached, an idle row grown more than 5 % over the published report or a scripted job not done fails the PR) and a contents check of the built wheel and sdist: the wheel holds the server and nothing else, and the sdist holds only what git tracks. The release gate runs the same three test lanes, plus a headless lane that runs the correctness suite against the previous tag with --fail-on-regression, before anything reaches PyPI. Releases are tag-driven: git tag vX.Y.Z && git push origin vX.Y.Z.

The live COM paths are checked on a running AutoCAD, never in CI: python scripts/smoke_verify_com.py --json out/verify.json (and the twelve other scripts/smoke_*_com.py) attaches to the open seat, works only in documents it creates, and closes them. python scripts/live/run_all.py runs all fourteen, each in its own process, and writes one matrix per release. For 1.8.0 every one passed in one run of one committed tree, with scripts/smoke_accore.py (the headless DWG read through accoreconsole) among them (AutoCAD 2026, 1.8.0): matrix.json. That run passed the five smokes written for 1.8.0, smoke_space_com.py, smoke_edit_com.py, smoke_render_com.py, smoke_lisp_com.py (the AutoLISP read tier) and smoke_durability_com.py (checkpoints, the refused in-place restore, a new_document restore), and the stages 1.8.0 added to older ones: set edits, dimension truth and dimension auto in smoke_settings_com.py, the revise stage in smoke_mech_com.py, and the avoid and project stages in smoke_pid_com.py (AutoCAD 2026, 1.8.0). The B40 stage of smoke_mech_com.py ran in the same run (AutoCAD 2026, 1.8.0) and skipped all eight feature tables, which ship with no rows.

Roadmap

1.7.1

  • Speed. Win back the headless creation throughput that 1.6 lost against v1.4.0 (criterion 7). Arm the per-call timeout only where a call can block, and remove the per-call work that came with it.

  • The XDATA rework: chunking, case and budget.

1.8

  • In 1.8.0 (first phase, see the changelog): the durable operation journal with idempotency across restarts, atomic saves, drawing_open(recover=True) (ezdxf.recover, first planned for 1.7.1), one typed error envelope, the property_override focus, in-place polyline and label edits, region screenshots, and the live engine's target space. Second phase: set-based edits (entity_modify_where, layer_rename, layer_merge), dimension_auto for a whole part, the QA coverage ledger and compact QA answers, the dimension_truth focus with dimensions redrawn on a style change, the tool and write-path policy and the HTTP guard, the AutoLISP read tier, session metrics, the token and call budgets in CI, durable checkpoints with undo after a restart, the atomic cad_batch default, drawing_history, and search mode by default. Third phase: mech_part_revise (parametric edit and rebuild of a drawn part, with its model history), obstacle-aware P&ID routing, pid_project across sheet files, a headless DWG read through accoreconsole, one display refresh per live job and bulk tools as one job, the B40 double-entry pipeline, and ADR 0001.

  • 1.8.1: the transcribed rows for DIN 471/472, DIN 509, DIN 332 and ISO 3601-2 (all eight tables deferred, each waiting on its licensed copy), the LISP write tier, batch lease and confirm_large, cad_batch step coalescing, the pid_project write side, mech_part_revise's reconciliation and keep-the-hand-edit modes, DWG export and AUDIT through accoreconsole.

1.9: IEC 60617 electrical schematics, reusing the P&ID track's symbol, port and graph machinery. A native .NET worker only if ADR 0001's rule fires on live measurements.

Architecture decisions live in docs/adr/: ADR 0001 records why 1.8.0 ships no native .NET worker and the rule that decides it for 1.9.0.

Features ship when their contracts and limitations are testable — not when they make a longer checklist.

Star History

Star History Chart

Author

Umutcan Edizsalan · Mechanical engineering work at Anka-Makine · GitHub @U-C4N

Built from production drawing work, then made model-agnostic through MCP.

License

MIT

mcp-name: io.github.u-c4n/autocad-mcp

Available Tools

243 tools
analysis_bounding_boxDrawing Bounding BoxA
Read-only

Get the bounding box (extents) of all entities in the drawing.

Inputs: no named parameters. Returns: object

analysis_entity_statsEntity StatisticsA
Read-only

Analyze the drawing and return entity counts grouped by type and by layer.

Returns: total_entities, by_type (sorted by count), by_layer (sorted by count). This is unique to AutoCAD MCP Pro – no other MCP server provides this!

Inputs: no named parameters. Returns: object

analysis_find_in_regionFind Entities in RegionA
Read-only

Find all entities within a rectangular region (crossing selection).

Uncapped: a window over a busy drawing returns every hit. Project with fields and/or compact before widening the window.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +2 more. Returns: result

analysis_layer_statsLayer StatisticsA
Read-only

Return detailed statistics for each layer: entity count, types present.

Inputs: no named parameters. Returns: object

analysis_list_propertiesList Entity PropertiesA
Read-only

AutoCAD's LIST: the full DXF attribute set for one handle.

dxf_attributes is the raw attribute set entity_get deliberately does not carry. Coordinates in it are WCS, like everywhere else in this server, and extrusion is reported so the entity's own frame is still visible.

Inputs: handle (required). Returns: object

analysis_measure_areaMeasure AreaA
Read-onlyIdempotent

Area and perimeter of a polygon you supply the vertices for.

This measures the numbers in the call, NOT the drawing. To measure something that exists, use analysis_measure_entity(handle) — it reads the real geometry, including curvature this tool can only see if you pass it.

Straight-edged polygons are exact. Pass a third bulge element per vertex for arc edges; omitting it on curved geometry under-reports (28% on a semicircular edge), which is why assumes says what was taken on faith.

Inputs: points (required). Returns: object

analysis_measure_distanceMeasure DistanceA
Read-onlyIdempotent

Measure the Euclidean distance between two points.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required). Returns: object

analysis_measure_entityMeasure EntityA
Read-onlyIdempotent

Measure something already in the drawing, by handle.

Reads the real geometry, so polyline bulges (arc edges) are included — reading vertices back and shoelacing them yourself loses 28% of the area on a semicircular edge, silently.

Measurable: LWPOLYLINE, 2D POLYLINE, CIRCLE, ELLIPSE, SPLINE, HATCH, SOLID, TRACE, 3DFACE. REGION and 3DSOLID need the live COM backend (their area is in ACIS data ezdxf cannot evaluate) and refuse with capability: "measure_area_acis". LINE/TEXT/INSERT bound no area on any engine and are a plain error, not a capability gap.

The payload states its own accuracy: exact is false when the shape had to be flattened (then flatten_tolerance says how finely), assumed_closed is true when an open boundary was closed the way AutoCAD's AREA does, and self_intersecting warns when the shoelace cancelled crossed lobes — a bowtie measures 0.0 and that number is worse than useless unflagged.

Inputs: handle (required), flatten_tolerance. Returns: object

analysis_select_by_layerSelect Entities By LayerA
Read-only

Get all entities on a specific layer. Returns entity list with handles.

Capped at MAX_LIST_LIMIT (default 5000). The plain list cannot say it was capped — the warning goes to the log stream, which most clients never show the model — so use compact=True when the count matters: its total is the layer's real population and truncated states whether the cap fired.

Inputs: layer_name (required), fields, compact. Returns: result

analysis_select_by_typeSelect Entities By TypeA
Read-only

Get all entities of a specific type. Returns entity list with handles.

Capped at MAX_LIST_LIMIT (default 5000); as with analysis_select_by_layer, compact=True is the only shape that reports total and truncated.

Inputs: entity_type (required), fields, compact. Returns: result

arch_catalogue_insertArchitecture: Catalogue InsertA

Define the item's block ARCH_ once, insert it on the furniture or sanitary layer.

The block carries an invisible ITEM attribute with the catalogue name. Its size is a nominal catalogue dimension (reported with size_basis), not a standards value; the outline is a plan symbol drawn inside that footprint. The furniture / sanitary layer is created from the arch layer set when the drawing lacks it. Refusals, all before any write: an unknown name (with the nearest catalogue names) and a non-finite coordinate or rotation.

Inputs: x (required), y (required), name (required), rotation. Returns: object

arch_catalogue_listArchitecture: CatalogueA
Read-only

Catalogue rows: name, family, both labels, nominal size [w, d] in mm, block name, layer.

Sizes are nominal catalogue dimensions - what a furniture or appliance catalogue lists as a common size - and every row says so in size_basis; they are not standards values. Twenty items: thirteen furniture, seven sanitary. Refusals: a family other than furniture/sanitary and a lang other than en/tr, each with the list.

Inputs: lang, query, family. Returns: object

arch_dimension_chainsArchitecture: Dimension ChainsA

The three exterior chains an architectural plan carries, as real DIMENSIONs.

Nearest first: the openings row (every jamb in that facade), the walls row (both faces of every wall meeting it - wall thickness, clear width, wall thickness, ...) and the overall row. The points come from the wall engine's own faces, read back from the plan on the drawing. A row that would only restate a farther one is not drawn (ISO 129-1: each measurement once). The row spacing defaults (10 mm, then 8 mm on paper) are this server's drafting choices, not standard values. Text, arrows and gaps follow the plot scale: each chain is drawn at DIMSCALE = scale (reported as dimscale), and the drawing's own DIMSCALE is put back afterwards.

Refused by name: a drawing with no walls, an unknown or repeated side, a non-positive scale, offset or step.

Inputs: step, scale, sides, first_offset. Returns: object

arch_gridArchitecture: Structural GridA

Axis lines on the arch grid layer (its CENTER linetype comes from the layer) and a 5 mm bubble with its label at both ends of each axis, on the symbol layer.

Numbers run along x and letters along y (A..Z, then AA, AB - no letter is skipped) unless labels names them. The bubble and label sizes are this server's declared drafting sizes in paper millimetres, not a standards value. Refusals, all before any write: an empty axis list in either direction, a non-finite or duplicate position, a label list whose length does not match its positions, a duplicate or empty label, an unknown labels key, and a non-positive extension or scale.

Inputs: x_axes (required), y_axes (required), scale, labels, +1 more. Returns: object

arch_openingArchitecture: Door / WindowA

A door or a window in a wall already drawn, found by its id; the wall is redrawn cut.

The opening removes its width from both wall faces and each edge is closed by a jamb. A door is drawn open at 90° - its leaf as long as the opening is wide, hinged on hand, with a quarter-arc swing on the swing side; a window is a frame line on each face and two glazing lines between them. The opening's ACADMCP_ARCH record sits on the leaf or the frame, so a schedule reads it back.

Refused before anything is drawn or erased: a wall id not on the drawing (the drawn ids are named), an opening id already drawn, an opening that runs past its wall segment or straddles an axis vertex, one overlapping another opening on the same wall (both ids named), one that runs into a junction (the solid stretch it must fit in is named), an unknown kind, swing, hand or language.

Inputs: wall (required), width (required), offset (required), tag, +8 more. Returns: object

arch_plan_from_specArchitecture: Plan From SpecA

A whole plan drawn inside one transaction: walls with their hosted doors and windows, stairs, room labels whose areas are measured off the walls just drawn, the exterior dimension chains and the door / window / room schedules.

Every item is validated before the transaction opens, so a refusal leaves the drawing untouched and names its path (walls[1].thickness: ..., rooms[0].area: ...). What only the drawing can refuse - a room point in no closed face - rolls the transaction back, and so does a cancelled request (the rollback runs under an anyio shield). The result carries each step's own result, the wall engine's omitted list and the three arch_* critique focuses run over the committed plan.

Refused by name: an unknown key, no walls, an unknown language or material, a non-finite or non-positive number, an arc segment in a wall axis, an opening that overlaps another or runs past its wall segment (both ids named), a typed room area (areas are measured, never typed), an unknown chain side or schedule kind, and a transaction that cannot be opened. Catalogue furniture, the grid and symbols are separate tools (arch_catalogue_insert, arch_grid, arch_symbol).

Inputs: spec (required). Returns: object

arch_roomArchitecture: Label RoomA

Label the room around (x, y) with its name, number and MEASURED area.

The area is never typed: the tool reads the wall faces on the wall layer of the arch set (LINE and lightweight polyline, both engines; anything else there is listed in skipped), finds the closed face the point lies in and writes that face's area - net of the wall thickness and of any column inside it - into the label and into an ACADMCP_ARCH room record on the name text, which arch_schedule reads. A door or window recorded on the drawing closes its gap along the wall faces, so two rooms either side of a door stay two rooms.

Refused before anything is drawn: an unknown lang (named with en, tr), a number/name the room model refuses, a room_id already labelled on the drawing, a point in no closed face of the walls (draw or close them first, or read a plan drawn by other means with arch_rooms_detect), a point inside a wall body, and a point in a room that already carries a label (one face, one room record - a retried call does not add a second area to the schedule).

Inputs: x (required), y (required), name (required), lang, +3 more. Returns: object

arch_rooms_detectArchitecture: Detect RoomsA
Read-only

Read the rooms of a plan - ours or a foreign one made of plain lines.

Every LINE and lightweight polyline on the layers is split where lines cross or touch, and the closed faces they bound are measured (mm², net of nested pieces). Faces under min_area, and thin faces (mean width under 600 mm - wall bodies and reveals, this reader's heuristic) are left out. Each room reports confidence: 1.0 when every edge lies on the arch wall layer, 0.6 when any edge is a plain line from elsewhere - read confidence_min before trusting a foreign plan. Room labels already on the drawing are reported in labels with the face they sit in; a face with more than one is listed in label_conflicts.

Never modifies the drawing. Arcs and bulged polyline edges, old-style POLYLINEs and block references are listed in skipped with their handle and reason - never flattened into chords, never dropped silently. Read skipped before trusting count. A foreign plan's open doorways are not closed - two rooms joined by one read as one face. Refused: a named layer the drawing does not have (with the list of the ones it has), and no layer matching WALL or DUVAR when layers is omitted.

Inputs: tol, layers, min_area. Returns: object

arch_scheduleArchitecture: ScheduleA

Draw a door, window or room schedule as a real TABLE - a read of the drawing.

The rows come from the ACADMCP_ARCH records on the drawing (what arch_wall / arch_opening / arch_room write), never from the caller: doors by tag with width, height, swing, hand and wall; windows by tag with width, height, sill and wall; rooms by number with name and the measured area, plus a total. An opening drawn without a tag gets the next free D1 / W1 (K1 / P1 in Turkish) in wall order; an explicit tag is kept. A value the model does not carry is an empty cell, never a default. representation reports what was drawn: native (ACAD_TABLE, live) or composite (rules and MTEXT, headless).

Refused before anything is drawn: an unknown kind or lang (named with the list), nothing of that kind on the drawing, and more rows than one TABLE takes (198).

Inputs: x (required), y (required), kind (required), lang, +1 more. Returns: object

arch_stairArchitecture: StairA

A stair in plan: every riser as a line, the outline, the walking line with its arrow.

The label ("UP" / "ÇIKIŞ") sits on the first tread at 2.5 mm × scale. The result reports blondel - 2R + G against 600-650 mm, the step-length rule attributed to François Blondel (1675). It is a design rule reported for the drafter, not a building code: no national stair regulation is checked and a value outside the band is reported (ok: false), not refused.

Refused before anything is drawn: a stair id already on the drawing, a non-positive width, riser height or going, fewer than 2 risers (4 for an L or a U - two per flight), a non-integer riser count, an unknown kind, turn or language.

Inputs: going (required), width (required), risers (required), start_x (required), +8 more. Returns: object

arch_symbolArchitecture: SymbolA

Draw one architectural symbol on the arch symbol layer.

Sizes are this server's declared drafting sizes in paper millimetres times scale (a 16 mm north-arrow circle, 10 mm section and elevation bubbles), not standards values. Refusals, all before any write: an unknown kind (with the list), a parameter the kind does not take (with the ones it does), a section mark without p1/p2, with an empty label, an unknown side or a cut line too short for its two arrows, an elevation direction outside up/right/down/left or named twice, a non-finite level value, and a lang other than en/tr.

Inputs: x (required), y (required), kind (required), lang, +2 more. Returns: object

arch_wallArchitecture: WallA

Add walls to the plan network already on the drawing and resolve every junction.

Two ends at one point mitre into a clean L; an end inside another wall is a T (the stem stops on the crossing wall's near face, which is cut there); two axes crossing are an X (all four faces cut). A drawn wall whose outline the new walls change is taken back out and redrawn with its openings - the result lists it under redrawn - and a wall they do not touch is left alone. Every wall carries an ACADMCP_ARCH record, so later calls find it by id.

Refused before anything is drawn or erased, by path: a wall id already on the drawing or used twice, an axis of fewer than two points or with a zero-length segment, a non-positive thickness, an unknown justification or material (the list is named), two walls meeting at less than 5° (the mitre would run away), a wall corner lying inside another wall off its axis, an end inside a wall whose axis only meets it past that wall's end, and a new wall that would leave a drawn opening uncuttable. A curved wall is not supported: an axis is straight segments only.

Inputs: walls (required), poche. Returns: object

balloon_addSheet: Add BalloonA

One ISO 6433 item reference: a numbered balloon, a leader, and a dot on the item.

The balloon carries an ACADMCP_MECH payload naming its targets, so running the balloon pass again after the bill of materials is regrouped renumbers the existing balloon (renumbered: true) instead of drawing a second one. Refusals, all before the first entity: an item number below 1, a leader target inside the balloon, and an item number already used by another balloon for different targets — named with that balloon's handle.

Inputs: x (required), y (required), item (required), leader_x (required), +5 more. Returns: object

batch_plotBatch PlotA

AutoCAD's PUBLISH for a PDF set, through drawing_export_pdf(layout=…).

One row per sheet: path, bytes, and mediabox_mm parsed from the PDF that was written (/MediaBox, points → mm), with paper naming the catalogue size it matches within 0.5 mm — so the sheet size is verified, never assumed. Model space is included only when named.

Refused before any file is written: a format other than pdf, an empty layouts list, a layout that does not exist, a file_pattern containing a path separator or lacking {layout} when more than one sheet is plotted, and any output path outside the allowed directories. A sheet whose PDF has no readable MediaBox is reported with mediabox_mm: null and an error.

Inputs: output_dir (required), format, layouts, file_pattern. Returns: object

block_create_from_entitiesCreate Block From EntitiesA

Create a new block definition from existing entities in the drawing.

Works on both engines. The originals stay in model space — this defines a reusable block from them rather than consuming them the way AutoCAD's BLOCK command does; use block_insert to place copies, and delete the originals yourself if you want the command's behaviour.

Handles that do not resolve are listed in skipped rather than silently dropped, and a call where none resolve fails instead of leaving an empty definition behind.

Inputs: name (required), handles (required), base_x, base_y. Returns: object

block_defineDefine BlockA

Create a block definition with attribute definitions from typed specs.

The whole request is validated before anything is written: one malformed entry refuses the call and leaves no definition behind. Refusals: a malformed primitive or ATTDEF (names entities[i]/attdefs[i] and the key), a non-finite base point (names base_x/base_y), a name clash without overwrite, an anonymous * name, and a primitive layer that is not in the drawing's layer table (names the missing layers) unless create_layers=true, which creates them and lists them in layers_created. overwrite=true replaces the contents of an existing block so its INSERTs keep pointing at the name and show the new geometry; replaced reports it. Geometry inside the block is ByBlock so the INSERT's layer supplies colour and lineweight. Insert with block_insert(attributes={TAG: value}).

Inputs: name (required), entities (required), base_x, base_y, +3 more. Returns: object

block_explodeExplode BlockA
Destructive

Explode a block reference into its component entities, keeping its attribute text (the Express Tools BURST rule, on both engines).

Every attached ATTRIB becomes a TEXT with the same value, placement, height, rotation and layer (an invisible attribute becomes an invisible TEXT; a multi-line attribute becomes an MTEXT carrying every line), and a constant attribute (which has no ATTRIB) becomes a TEXT of its value too; AutoCAD's plain EXPLODE would keep only the tag-name placeholders and drop the values. Everything lands in the layout that owns the reference (model space or its paper-space sheet), whichever tab is current. Returns inserted_handles (the geometry), attribute_texts (one TEXT or MTEXT handle per attribute), exploded_handle and backend. Refused, with nothing written: a handle that is not a block reference, a reference nested inside a block definition (explode the outer reference instead), an external reference (bind it first), a MINSERT grid, and -- headless only, capability explode_opaque_members -- a block holding a member ezdxf cannot transform (an OLE2FRAME logo, a VIEWPORT, a proxy entity without proxy graphics), named by member; the live engine hands those to AutoCAD. Not undoable except through drawing_undo / a transaction.

Inputs: handle (required). Returns: object

block_find_referencesFind Blocks By NameA
Read-only

Find all insert references to a specific block definition.

Bounded by the backend's own default entity_list page (200 INSERTs scanned), which is a pre-existing limit, not a new one: the compact envelope's total counts the references found within that scan.

Inputs: name (required), fields, compact. Returns: result

block_get_attributesGet Block AttributesA
Read-only

Get all attribute values from a block reference as {TAG: value} dict.

A multi-line attribute reports its whole content with \P between the lines (AutoCAD's TextString), on both engines.

Inputs: handle (required). Returns: object

block_insertInsert BlockA

Insert a block and optionally set attribute values.

Refused before any write, on both engines: an undefined or layout block name, and an attribute value that is not text — a string is written as is (one line), an int or finite float as its plain digits (101 → "101"), while null, booleans, lists and objects are refused naming the tag (they used to be written as their Python repr). Values for tags the block does not define are ignored.

Inputs: x (required), y (required), name (required), layer, +4 more. Returns: object

block_listList BlocksA
Read-only

List all block definitions in the drawing (name, origin, attribute count, entity count).

Never truncated — the whole block table is returned — so a compact envelope here always reports truncated=false.

Inputs: fields, compact. Returns: result

block_set_attributesSet Block AttributesA

Update attribute values in a block reference.

Same value rule as block_insert: strings and numbers are written, null / booleans / lists / objects are refused naming the tag before anything changes. updated_tags lists the tags that exist on the reference and were written; unknown tags are ignored.

A multi-line attribute takes Line1\PLine2 and keeps every line; the value written is the one block_get_attributes reads back and block_explode bursts, on both engines.

Inputs: handle (required), attributes (required). Returns: object

bom_extractSheet: Extract Bill of MaterialsA
Read-only

Walk the INSERTs and return the ISO 7573 item rows. Never modifies the drawing. bom_table is what draws them.

Each row's source is reported: xdata when the ACADMCP_MECH payload supplied it (what std_part_insert writes), attributes when the block's own ATTRIBs did. A block with neither a payload nor a DESIGNATION attribute is skipped rather than guessed at, and skipped counts them.

The whole drawing is read by default — entity_list's 200-entity page is paged through, not taken as a cap, because an item list that stops at the 200th INSERT prints a wrong QTY rather than a shorter one. Pass limit to cap it deliberately; truncated is then true if and only if the cap cut the list. Refusals: an unknown column or group_by field, named with the list of the ones there are.

Inputs: layer, limit, columns, group_by. Returns: object

bom_tableSheet: Draw Parts ListA

Draw the ISO 7573 item list as a real TABLE entity, 180 mm wide (the title-block width), growing upwards from directly above the title block.

With direction="up" the heading row sits against the title block and item 1 is the row above it, so the list extends upwards as parts are added — which is what ISO 7573 asks for on a drawing. Pass rows to draw a list you already have, or omit it and the tool runs bom_extract first. representation reports what was drawn: native (a real ACAD_TABLE on the live engine) or composite (rules and MTEXT headlessly, whose handle is the first child). Refusals: no rows to draw, an unknown column, an unknown direction, a layout that does not exist.

Inputs: at_x, at_y, rows, size, +7 more. Returns: object

boundary_from_entitiesBoundary from EntitiesA

Chain the given entities into one closed polyline.

The handles may arrive in any order — putting them in chain order is the tool's job. A chain that does not close is refused, and the error names the coordinates of the gap.

Inputs: handles (required), tolerance. Returns: object

boundary_traceTrace BoundaryA

AutoCAD's BOUNDARY/BPOLY: create a closed polyline around a seed point.

Returns the nearest enclosing loop, so a seed inside an island gives the island rather than the outer region. Straight edges are split where they cross, so a line drawn across a shape divides it the way it looks like it should. A seed with no enclosing loop is refused, and the error names the gap when the edges nearly close.

Inputs: x (required), y (required), layer, tolerance. Returns: object

cable_takeoffPlant: Cable TakeoffA

A cable takeoff: one row per electrical load, the shop's cable method made repeatable.

Power, phases, voltage, neutral and VFD come from the P&ID's electrical texts near each tag (Russian, Turkish and English spellings). Power is never invented: a load with no stated kW keeps an empty cell and an open item. The panel comes from the layout's wiring callouts ('Wiring to CP1' and its variants, normalised to CP-1), else from the P&ID ('к CP1'); a load neither places takes the nearest panel on the layout, flagged panel_inferred (panel_rule='stated' leaves it open). The length is the Manhattan distance on the layout from the load's tag to its panel's tag, and the cable is ROUNDUP(length x (1 + allowance)) to the metre. Room and panel totals count known power once: a load wired to a panel that states its own power is part of that package, and the package's power is counted instead of its children's - the rule is written on the method sheet. Sections only from section_rules; no standard table is applied. Open items: missing power, missing panel, a tag or panel not on the layout, no layout at all, a load no section rule covers.

Read-only on both drawings. With output it writes one workbook - Metraj, Özet, Kontrol, Metodoloji - as XLSX and, always, as CSV beside it.

Refused before a drawing is read: lang outside tr / en / ru, an allowance outside 0-1 and a malformed section rule (named by its path, section_rules[0].section: ...). A missing, unreadable or oversize drawing is refused by the reader, which names MAX_DXF_BYTES. Without openpyxl the XLSX is not written and files.refused carries capability: "xlsx_write" naming the office extra; the CSV files are written all the same.

Inputs: lang, output, pid_path, allowance, +3 more. Returns: object

cad_batchBatch: Run ToolsA
Destructive

Execute an ordered list of tool calls in ONE round trip.

N calls collapse into one request/response pair, and bind lets a later step reference an earlier step's result so handles never have to be echoed back through the model.

steps=[
  {"tool": "entity_create_line",  "args": {...}, "bind": "edge"},
  {"tool": "point_from_snap",     "args": {"handle": "$edge", "snap": "mid"},
                                  "bind": "mid"},
  {"tool": "entity_create_circle","args": {"cx": "$mid.x", "cy": "$mid.y",
                                           "radius": 4}},
]

Successful steps report only their handle; pass verbose=True for the full result. Anything without a handle is returned whole.

VALIDATION runs first, always: an unknown tool, a schema-invalid argument or a reference no earlier step binds refuses the whole batch before anything executes. on_error governs run-time failures only. dry_run=True returns that validation report and executes nothing.

ERRORS are typed, never text: each failed step carries error.kind - one of unsupported (with the backend capability), invalid_args, refused, failed, unknown_tool, unresolved_ref, denied, malformed_step, quarantined, busy, active_document_changed (live engine: the operator switched documents), stale_revision, scan_incomplete, timed_out, unknown_commit (a write that outran its deadline while its worker ran), cancelled, operation_conflict - and its own operation_id.

PREVIEW AND APPLY. dry_run=True also returns preview: the document id and content revision, the exact fingerprint of every LITERAL handle in a handle parameter (a '$reference' resolves late and an entity a step creates has none) and the planned steps. Pass its revision as expected_revision and its preconditions back, and the batch runs only if nothing moved - otherwise it is refused with kind stale_revision and no step runs. A guarded batch reports revision: {checked, after, interleaved}; each step is its own locked call, so a change another call made between two steps is listed under interleaved (a rollback restores the checkpoint, that change included).

OPERATIONS: the batch and each step are operations with their own ids (system_status lists the recent ones). Pass operation_id (or the request's _meta.operation_id) to make a retry safe: the same id with the same steps replays the recorded result instead of drawing twice. The journal is in memory: a server restart forgets it (durable in 1.8.0, B13).

ATOMICITY is reported, not assumed. Read the atomicity block: on the headless backend rollback restores a full document snapshot; on live AutoCAD it sends an UNDO whose landing AutoCAD never confirms. The default on_error="stop" claims nothing and is exact on both. A checkpoint a step opens with transaction_begin is closed with the batch's (unwound).

NOT CALLABLE from a batch: the raw command/LISP escape hatches, and cad_batch itself. Call those directly.

For a few hundred entities of the same kind, entity_batch_create is denser still (no per-step tool name) - and it can be one step of a cad_batch.

Inputs: steps (required), dry_run, verbose, on_error, +3 more. Returns: object

centre_marksCentre Marks (ISO 128-23)A

Centre marks on the CENTER layer, whose linetype carries ISO 128-23's dash pattern.

Pass handles and the radii are read back with entity_get rather than restated — a radius from memory is the classic silent wrong number. Refusals, all before the first entity is written: neither handles nor centers given (or both), a handle that is not a CIRCLE or ARC, a circle in a plane tilted out of WCS XY (capability ocs_tilted_plane, so it has no radius in this frame), a style outside mark/lines, a non-positive extension, and style='lines' on a centre given without a radius.

Inputs: layer, style, centers, handles, +1 more. Returns: object

construction_clearConstruction: Clear (delete scaffold)A
Destructive

Delete every entity on the CONSTRUCTION layer. Idempotent. Must be called before drawing_finalize to satisfy construction_left critique.

Inputs: layer. Returns: object

construction_xlineConstruction: XLine (infinite reference)A

Create an infinite construction line on the CONSTRUCTION layer. Use as scaffolding; call construction_clear() before finalize.

Inputs: x (required), y (required), angle_deg (required), layer. Returns: object

data_extractSheet: Extract DataA

The same rows bom_extract returns, written to a file.

Refusals: a format that is not 'csv' or 'xlsx'; a drawing with nothing to itemise (nothing is written); and fmt='xlsx' without openpyxl, which carries capability: "xlsx_write" and names both the package to install and the CSV route that always works.

Inputs: path (required), fmt, layer, columns, +1 more. Returns: object

datum_featureGD&T: Datum Feature (ISO 1101)A

Place a datum feature symbol (filled triangle + boxed letter).

Establishes the datum so a feature control frame referencing this letter passes the gdt critique focus.

Inputs: x (required), y (required), letter (required), size, +1 more. Returns: object

dimension_alignedAligned DimensionA

Create an aligned dimension that measures the true distance between two points.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +3 more. Returns: object

dimension_angularAngular DimensionA

Create an angular dimension measuring the angle between two lines from a vertex.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +5 more. Returns: object

dimension_autoDimension: Auto (chain / baseline / ordinate)A

Generate ISO 129 dimensions across the listed entities in the chosen style. V1 supports LINE entities only.

Inputs: handles (required), style, offset. Returns: result

dimension_diameterDiameter DimensionA

Create a diameter dimension for a circle, optionally toleranced (e.g. ⌀20 H7).

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +7 more. Returns: object

dimension_linearLinear DimensionB

Create a linear dimension, optionally toleranced (ISO 129 or ISO 286 fit).

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +9 more. Returns: object

dimension_radiusRadius DimensionA

Create a radius dimension for a circle or arc, optionally toleranced.

Inputs: chord_x (required), chord_y (required), center_x (required), center_y (required), +7 more. Returns: object

dimstyle_createStyles: Create Dimension StyleA

Create a dimension style: preset values first, then overrides.

Refuses, before anything is written: an unknown preset; an override key outside the 33-variable whitelist (the 17 preset variables plus DIMTOL, DIMTP, DIMTM, DIMTOLJ, DIMTFAC, DIMLFAC, DIMRND, DIMATFIT, DIMTMOVE, DIMCLRD/E/T, DIMSAH, DIMBLK1/2, DIMCEN); a value outside its range (DIMDEC 0-8, sizes > 0, DIMTAD 0-4, DIMDSEP one character, lineweights an AutoCAD code); a name that already exists (use dimstyle_modify); a user DIMBLK/DIMBLK1/DIMBLK2 naming a block the drawing does not define (built-in arrowheads need none); a DIMTXSTY that is neither an existing text style nor a bundled preset (ISOCP, ISOCPEUR, ARIAL, ROMANS — those are created on both engines, textstyle_created; live, a preset whose font file the seat lacks is refused the same way, nothing written). On the live engine a write ActiveX still refuses after the style is added is rolled back — previous style current, the half-made entry deleted. With set_current the next dimension carries the style on both engines.

Inputs: name (required), preset, overrides, set_current. Returns: object

dimstyle_listStyles: List Dimension StylesA
Read-only

Every DIMSTYLE table entry with the seventeen preset variables (DIMTXT, DIMASZ, DIMEXE, DIMEXO, DIMGAP, DIMTAD, DIMTIH, DIMTOH, DIMDEC, DIMDSEP, DIMLUNIT, DIMZIN, DIMBLK, DIMTXSTY, DIMLWD, DIMLWE, DIMSCALE).

Headless, values is what the DXF stores (the schema default where an entry omits a code). On the live engine ActiveX has no per-style getters, so values is read for the current style only and the other rows carry values: null, values_available: false — dimstyle_set_current a style to read it. Never refuses on an open drawing.

Inputs: no named parameters. Returns: object

dimstyle_modifyStyles: Modify Dimension StyleA

Change variables on an existing dimension style.

changed names only the variables that actually moved — re-setting a value to itself is not a change. dimensions_using_style lists the dimensions already drawn with it; headlessly rerender_required: true says they still show the old style until redrawn (AutoCAD re-renders on the next regen). Refuses a missing style, an empty overrides, a key outside the whitelist, a value outside its range, a DIMTXSTY that does not exist, a user arrowhead block the drawing does not define — all before any write. On the live engine, editing a non-current style makes it current for the duration of the call and the previous style is restored — also when a write fails midway (its unsaved overrides are discarded, which is AutoCAD's own DIMSTYLE rule).

Inputs: name (required), overrides (required). Returns: object

dimstyle_set_currentStyles: Set Current Dimension StyleA

Set $DIMSTYLE and load the style's variables as the current DIM* settings — what a live seat's DIMSTYLE Restore does — so dimension_* and dimension_auto draw with it on both engines. Per-dimension tolerances, fits and text overrides still apply on top. Refuses a style the drawing does not hold. Returns previous and changed.

Inputs: name (required). Returns: object

document_activateActivate DocumentA

Make one open document the active one; reports previous.

Matches the full path first, then the file name; an ambiguous name is refused with the candidates, an unknown one with the list of open documents. Headless, a document quarantined after an abandoned call cannot be switched away from — drawing_new, drawing_open or closing it are the ways out. Pack: settings · lean: no.

Inputs: name_or_path (required). Returns: object

document_closeClose DocumentA
Destructive

Close a document and report saved, discarded_changes and the new active.

Refusals, all before anything is closed: unsaved changes with neither save nor discard; save on a document that has never been saved (no path to write — live, Close(True) would open AutoCAD's Save dialog and block the COM thread); save together with discard. Closing the last document leaves the backend with none open, which every tool already reports. drawing_close is the same operation for the active document with its 1.4 contract kept. Pack: settings · lean: no.

Inputs: save, discard, name_or_path. Returns: object

document_listList DocumentsA
Read-only

Every open document with name, path, active, saved and entity_count. Each row also carries the document's document_id and content revision (None, live, for a document this session never bound).

Headless, the server keeps its own registry: drawing_new / drawing_open add an entry (untitled-N or the file path) instead of replacing the only one, and document_activate chooses which one every later tool targets. Live, this is AutoCAD's Documents collection. No refusals: an empty backend answers with an empty list. Pack: settings · lean: no.

Inputs: no named parameters. Returns: object

drawing_apply_iso_layersDrawing: Apply ISO Layer Set (bootstrap)A

Bootstrap a full ISO-conformant layer set with correct colors and lineweights. Idempotent — existing layers are not modified.

Refused by name: a standard that is not one of mech, pid, iso13567, arch.

Inputs: standard. Returns: object

drawing_apply_standardDrawing: Apply Drafting StandardA

One call for the common case: the standard's dimension style (created if missing, then current), its text style (created if missing, then current), the shared units, and with layers the mech layer set (ANSI layer naming is company-specific, so both standards share it).

Every item reports created or already present; settings.changed names only the variables that moved, so a second call reports nothing. An existing ISO-25 / ANSI style is reused as it is, not reset — use dimstyle_modify to change one. Refuses an unknown standard, or a units variable it cannot read back, before any write; the underlying style refusals (dimstyle_create, textstyle_create) apply unchanged. In the lean profile (Task 13).

Inputs: standard (required), units, layers. Returns: object

drawing_auditAudit DrawingA

Audit the drawing: repair every fixable structural problem, and report it.

This mutates the drawing. fixes lists repairs that have ALREADY been applied, so save afterwards to keep them; errors lists problems that could not be repaired. On the live COM backend AutoCAD applies repairs but hands back no counts, so they arrive as null with detail: "unavailable" rather than as zero.

Inputs: no named parameters. Returns: object

drawing_closeClose DrawingA
Destructive

Close the active document. If save is True (default), the drawing is saved to its current path before closing; an untitled document is closed and warning says its changes were discarded (headless) or the call is refused (live, where the alternative is a modal Save dialog). The active-document case of document_close; after the last document is closed, call drawing_new or drawing_open before any other tool.

Inputs: save. Returns: object

drawing_critiqueDrawing: Critique (premium quality checks)A
Read-only

Run premium-quality checks. Returns zero issues for a clean drawing.

Standard production gate: must return [] before drawing_finalize.

The entity checks (construction_left, untrimmed_corner, duplicate_entities, dim_overlap) read every entity of every space - model and every paper layout - and compare pairs only within one space. Refusals and failures are issues, never silence: a check that raises returns an error issue of its focus with detail.code check_failed; a read that could not cover the drawing (more than MAX_QA_ENTITIES entities, default 2,000,000; or a live export whose per-layout counts differ from AutoCAD's) returns detail.code scan_incomplete. Neither code is a focus name. A quarantined document is refused.

Inputs: focus. Returns: result

drawing_deliverDrawing: Deliver Auditable BundleA
Destructive

Create a hashed, validated delivery bundle and verify DXF save/reopen parity.

The result status is success, failed_validation, failed_export or failed_acceptance. Failure intentionally keeps all generated artifacts for diagnosis.

The open document is never re-pointed or saved: the DXF is a copy (live: Document.Export), and the manifest records the document's id, revision, path and saved flag, the DXF version, every sha256 and the build. Parity reads the delivered DXF back and compares it with a fresh serialisation of the document over every space: zero changed, added or removed entities, the same counts per space, the same block definitions. Both sides are exports, so parity cannot see content the export itself loses (parity.scope says so); with requirements, parity.content_check is acceptance, the check that can.

With requirements every requirement is measured on the delivered DXF, read fresh and re-bound from the document; the bundle gains acceptance.json and acceptance.md, the result geometry_acceptance, drafting_quality (the unchanged score), artifact_integrity, coverage and blocking, and a requirement that does not pass, stale evidence or a dimension that disagrees with its geometry makes the status failed_acceptance whatever the score (failed_export and failed_validation are reported first). Refused before any work: requirements that do not parse (invalid_args).

Inputs: output_dir (required), formats, expected, min_score, +2 more. Returns: object

drawing_diffDrawing: Diff Two RevisionsA

Compare two revisions of one drawing by geometric signature (spec §10).

Entities are matched exactly first (type, layer, geometry rounded to tol, text, block, attributes - handles do not matter), then by handle while handles look stable, then by type + layer + nearest position within move_tol; what is left is added or removed. The report counts changes by layer and type, lists each changed entity with what changed (moved by, text from -> to, attribute from -> to, radius from -> to, ...), compares the block definitions when both revisions are DXF files or the headless current document, and groups the changes into clusters.

Read-only unless markup=True: then revision clouds are drawn around the model-space clusters on the current document, which must be the newer revision, and filed as one revision row - the only write this tool makes.

Refused before anything is read: markup=True with new_path (the clouds go on the current document), markup=True without a valid rev, markup=True on an engine without the revcloud capability (the live engine - capability: "revcloud"), a path that does not exist, a DXF over MAX_DXF_BYTES (the size and the variable named), a file that is not a readable DXF, and a non-positive tol or move_tol.

Inputs: old_path (required), rev, tol, limit, +4 more. Returns: object

drawing_export_dwgDrawing: Export DWGA

Write a real DWG — not a DXF under a .dwg name.

On a live AutoCAD seat this is Document.SaveAs with the matching AcSaveAsType, which (as AutoCAD's own SaveAs does) leaves the session bound to the file it just wrote. Headlessly it needs the ODA File Converter; when that is absent the call is refused with capability: "dwg_write" and the refusal names the install route and drawing_export_dxf, which writes a DXF AutoCAD opens unchanged. Check system_capabilities first: the ezdxf flag is re-evaluated at call time, so installing the converter changes it without a restart. An unknown version is refused by name with the six.

Inputs: path (required), version. Returns: object

drawing_export_dxfExport DXFA

Export the current drawing as a DXF copy.

The open document is never re-pointed: it keeps its name, path and saved flag (drawing_save_as is the call that re-points). Live: Document.Export, renamed to the name given; headless: a copy written by ezdxf. The result names the method and the DXF version written. Refused: a name that is not .dxf (a .dwg headlessly with capability dwg).

Inputs: path (required). Returns: object

drawing_export_pdfExport PDFA

Export the current drawing (or a paper-space layout) to PDF.

Inputs: path (required), layout. Returns: object

drawing_finalizeDrawing: Finalize (validate + save + screenshot)A
Destructive

Premium completion gate: runs BOTH the 8-step validator AND the premium critique focuses (iso128, layer_color, dim_overlap, untrimmed_corner, duplicate_entities, construction_left, gdt, plus the P&ID focuses pid_dangling_line, pid_duplicate_tag, pid_incompatible_connection, pid_untagged_instrument, pid_illegal_tag, pid_unconnected_equipment — silent on a sheet with no P&ID symbols, plus the mechanical focuses mech_missing_centreline, mech_unhatched_section, mech_view_misaligned, mech_duplicate_dimension, mech_thread_unrepresented, mech_bom_balloon_mismatch — silent on a sheet with no mechanical part, plus the architectural focuses arch_room_unlabelled, arch_wall_gap, arch_opening_clash — silent on a sheet with no ACADMCP_ARCH record, plus the topology focuses topo_dangling_endpoint, topo_near_miss, topo_interior_crossing — on network layers no P&ID or architectural focus reads, silent on every sheet this server draws), then saves to disk, exports a screenshot, and returns the DWG path.

The validator and the critique share one read of the drawing - every entity of every space, model and paper, with no cap (one DXF export on the live engine). A drawing over MAX_QA_ENTITIES (default 2,000,000; 0 disables) is not read in part: the validator reports scan_incomplete and each entity check reports an issue with detail.code scan_incomplete, so the gate fails. A check that raises is an error issue with detail.code check_failed, never a clean result.

Raises ToolError if any validator 'error' finding is present, or if critique reports an 'error' (or, with strict_critique=True, any critique issue). Critique warnings are surfaced under payload['critique'] without failing the gate by default. A quarantined document is refused.

With requirements (the drawing_verify_requirements shape) every requirement is measured on the CAD geometry after the save: the payload adds geometry_acceptance (the full report), drafting_quality (the score, unchanged), artifact_integrity (the saved file's sha256 and reverified: every requirement measured again on the saved file, read fresh and re-bound by handle, feature tag, then geometry, with the before / after comparison; a saved file that cannot be re-read - a .dwg AutoCAD will not let us copy - fails the acceptance) and coverage, and a requirement that does not pass, stale evidence or a dimension that disagrees with its geometry raises failed_acceptance - a high drafting score never offsets it. Requirements that do not parse are refused before anything is saved (invalid_args).

Inputs: expected, save_path, requirements, screenshot_path, +1 more. Returns: object

drawing_infoDrawing InfoA
Read-only

Get comprehensive metadata for the current drawing.

Returns: name, path, entity_count, layer_count, block_count, extents (min/max), units, version, backend name, and the document's document_id (a uuid4 hex minted when it was opened or created) and revision (its content revision: moved by every content change, never by a save, an export, a finalize or a delivery). On the live engine a call made after the operator switched AutoCAD's active document is refused with kind: "active_document_changed" (bound, active).

Inputs: no named parameters. Returns: object

drawing_newNew DrawingA

Create a new drawing, optionally from a template.

A bundled name resolves to templates/<name>.dxf headlessly and templates/<name>.dwt on the live engine (falling back to the DXF with source: "bundled_dxf" when no .dwt twin is committed); a path is used as given. The result carries template: {name|path, path, source}.

On the live engine only a genuine .dwt reaches Documents.Add — measured on AutoCAD 2026, Add(<file.dxf>) silently returns the default drawing — so a .dxf template (bundled or a path) is first converted through AutoCAD into a cached .dwt and template.dwt names it (template.dwt_cached says whether the conversion was reused). The drawing then really carries the template's layers, tabs and page setup.

Refused before anything is replaced: a bare name that is not in the catalogue (the message lists the five), a template path that does not exist, and a path outside the allowed directories. With bootstrap=True (default) the standard engineering linetypes and layers are ensured afterwards — idempotent on a template that already has them.

Inputs: template, bootstrap. Returns: object

drawing_openOpen DrawingA

Open an existing DXF drawing file (DWG too, on the live COM backend).

T0.2: a .dwg path is refused up front when the active backend has no dwg capability. ezdxf sniffs content rather than extensions, so it would parse a mislabelled DXF-in-a-.dwg and this tool would answer with a document that does not exist in that format.

Inputs: path (required). Returns: object

drawing_planDrawing: Plan (commit intent before drawing)A

Commit a PlanSpec before any geometry is created.

The PlanSpec is stored on the backend and surfaced for reference during the workflow (it is not replayed as a critique). Always call this FIRST in a premium workflow. With typed requirements.items the plan carries requirement_digest; persist_requirements=True also writes the set into the drawing (requirements_persisted: true) - the server's own XRECORD, shown nowhere in AutoCAD.

Refused: a spec_hash that does not match the latest ready preflight; a malformed typed item, by its path (items[2].target.nominal: must be greater than zero, got -1.0.); persist_requirements=True with neither typed items nor a legacy dimensions object ("nothing to read"). A refusal stores nothing and commits no plan.

Inputs: intent (required), notes, scale, dim_style, +6 more. Returns: object

drawing_preflightDrawing: PreflightA
Read-only

Validate and normalize requirements before committing a drawing plan.

Typed requirements go under requirements.items: each is checked with its path (items[2].target.nominal: must be greater than zero, got -1.0. comes back as an INVALID_REQUIREMENT conflict) and its canonical form replaces the input in normalized_spec, so spec_hash covers what will be verified; requirement_set carries the canonical set and its digest. A legacy dimensions object is still accepted, kept as given and listed under legacy - it is never measured. Conflicting provenance is kept and reported (CONFLICTING_PROVENANCE, CONFLICTING_REQUIREMENT), never collapsed to one value. Typed items are validated once units is known (a MISSING_UNITS question asks for it). Nothing is refused: every problem is a question or a conflict, and ready stays False until none is left.

Inputs: intent (required), scale, dim_style, sheet_size, +4 more. Returns: object

drawing_properties_getDrawing Properties (read)A
Read-only

The DWGPROPS dialog as data: summary (title, subject, author, keywords, comments), summary_available, and custom ({key: value}).

On the live engine the summary comes from the document's SummaryInfo. The headless engine cannot read that stream, so the five summary fields are null with summary_available: false — not empty strings, which would claim the drawing has no title. Custom properties ($CUSTOMPROPERTYTAG / $CUSTOMPROPERTY header pairs) are read on both engines.

Inputs: no named parameters. Returns: object

drawing_properties_setDrawing Properties (write)A

Write DWGPROPS fields. Only the arguments given are touched; returns summary_written, custom_written and custom_deleted (a key that was never there is not reported deleted).

Refusals, before anything is written: a summary field on the headless engine (capability: dwgprops — SummaryInfo lives in the DWG, a DXF has no slot for it; custom properties still work headlessly), a non-string value (TypeError naming the field or key — nothing is coerced with str()), an empty custom key, a custom key to write that AutoCAD's AddCustomInfo would reject mid-write (measured on AutoCAD 2026: leading or trailing whitespace, or any of the thirteen characters " * , / : ; < = > ? \ |anywhere in the key; internal spaces, tabs and unicode are fine —ValueErrornaming the key, on both engines; a delete is exempt because RemoveCustomByKey never validates syntax, so a key that reached the drawing another way stays removable), two keys in one request that AutoCAD would call the same key (its key compare is a simple per-character case compare:Project/PROJECTandGrün/GRÜNare one key,Straße/STRASSE are two), a line break in a custom key or value (it corrupts the DXF on save), and headlessly a document older than R2004 (ValueError` — ezdxf only writes the custom-property header pairs for AC1018+, so they would vanish at save; save as R2004 or newer first). A key is matched to the drawing by that same rule on both engines and keeps its stored spelling when updated. On the live engine an exact spelling is changed with SetCustomByKey; otherwise AutoCAD decides — AddCustomInfo, and on its 'Duplicate key' SetCustomByKey; a delete is RemoveCustomByKey, and its 'Key not found' is reported as not deleted.

Inputs: title, author, custom, subject, +2 more. Returns: object

drawing_purgePurge DrawingA

Purge all unused objects (layers, blocks, linetypes, styles) from the drawing.

Inputs: no named parameters. Returns: object

drawing_redoRedoA

Reapply the operation you just undid.

Same history as drawing_undo, so the headless backend needs EZDXF_UNDO_DEPTH set. Anything drawn after an undo discards the redo branch — otherwise redo would restore a state that never existed, with geometry you had removed reappearing beside geometry you drew afterwards.

Inputs: no named parameters. Returns: object

drawing_refineDrawing: RefineA
Destructive

Run a bounded, transaction-safe critique/repair/re-critique loop.

dry_run=True returns the plan with preview - the content revision and the exact fingerprint of every handle a planned repair touches - also when the score already meets min_score: threshold_met then says an apply at that min_score would stop before repairing. Applied with the preview's revision (expected_revision) and/or preconditions, the call is refused with kind stale_revision and nothing changed when the document moved since; the result then carries revision ({checked, after, interleaved}).

Inputs: focus, dry_run, min_score, max_rounds, +3 more. Returns: object

drawing_saveSave DrawingB

Save the current drawing. Optionally specify a new path.

Inputs: path. Returns: object

drawing_save_asSave AsA

Save current drawing to a new path/format (DWG, DXF, or DWT template).

The on-disk format is derived from the file extension so the bytes always match the name (N2) — e.g. 'part.dxf' writes DXF, not DWG. format overrides only when the path has no recognised extension.

Inputs: path (required), format. Returns: object

drawing_scale_checkUnderstand: Scale CheckA
Read-only

Is the drawing to scale against the reference - or a schematic whose lengths are lengths of drawn line, not of pipe? Read-only on both drawings.

Equipment tags are matched between the two (a Cyrillic look-alike such as Т4100 is the Latin T4100). Only a tag found exactly once in each is used; a tag found more than once (plan copies, a legend, a second sheet) is listed in ambiguous and takes no part. When a drawing holds several bodies of content (two copies of one plan), the pair of scopes - whole drawing or one cluster on each side - that matches the most tags is used and named in scope. For every two matched tags at least min_pair_mm apart on the reference, the ratio of their distances is taken (both in millimetres by each drawing's inferred unit, see drawing_understand). The result gives the matched tags, the median ratio, the quartiles and their range, the share of pairs within +/-10 % of the median, the same per room of the reference (or per cluster for tags in no room) in groups, and a verdict: to_scale (at least 80 % within the band; factor is the median, so a uniform other scale is recognised), schematic (50 % or less), partly in between, insufficient with fewer than three matched tags or no pair above the floor. Tag labels are not equipment centres; the band and the floor absorb that offset, and the result's notes say so.

Refused before anything is read: a reference or path that does not exist, a DXF over MAX_DXF_BYTES (the refusal names the size and the variable), a file the engine cannot parse (a DWG headlessly), and a min_pair_mm that is not a positive finite number.

Inputs: reference (required), path, min_pair_mm. Returns: object

drawing_settingsDrawing Settings (read / change)A

Read or change common AutoCAD drawing settings by friendly name.

A convenience facade over the system variables (INSUNITS, LUPREC, LTSCALE, DIMSCALE, DIMTXT, DIMASZ, DIMDEC, DIMDSEP, DIMZIN, TEXTSIZE, OSMODE, LIMMIN/ LIMMAX, GRIDMODE/GRIDUNIT, SNAPMODE/SNAPUNIT, ORTHOMODE, AUTOSNAP/POLARANG, PSLTSCALE, CANNOSCALE, LUNITS, AUNITS, DIMSTYLE, TEXTSTYLE) so the user can say "set units to mm, limits to A3 and the grid on" without memorising sysvar names. Call with no argument for a full snapshot; a write returns applied, changed ({key: [old, new]} — only what moved) and errors.

dim_text_height / dim_arrow_size / dim_decimals / decimal_separator / zero_suppression shape the dimension — text_size is TEXTSIZE, the height of a standalone TEXT entity, and does not touch dimensions.

Refusals, per key, nothing else rolled back: an unknown key; a value outside its range (grid/snap spacing > 0, polar_angle 0–360, precision 0–8, …); a malformed limits or annotation_scale; osmode / polar / polar_angle on the headless engine (capability: registry_sysvar — AutoCAD keeps them in the registry, a file cannot, and a headless snapshot reports them as None); dimstyle / textstyle when the backend has no styles contract. On the live engine annotation_scale must name a scale in the drawing's scale list (SCALELISTEDIT) and AutoCAD refuses the write on a paper-space layout with no active viewport; the headless engine adds the scale, seeding AutoCAD's default list first when the drawing has none, and refuses it on an R12 file (no OBJECTS section, so the value would vanish at save — save as R2000 or newer first; limits/grid/ortho survive). Headlessly, grid/snap are stored on the active VPORT and the annotation scale in the variable dictionary — the places AutoCAD reads them from.

Inputs: settings. Returns: object

drawing_template_listList Drawing TemplatesA
Read-only

The templates drawing_new(template=<name>) can start from.

Each row: standard (ISO/ANSI), sheet, paper, layout (the sheet tab's name), layer_set (mech / pid / iso13567), dimstyle / textstyle (ISO-25 / ISOCP or ANSI / ROMANS), scale, title_block (the ISO 5457 A3 frame, A3 sheets only), the settings applied, and files.dxf / files.dwt with present flags — the .dwt twins exist only once built on a live AutoCAD (scripts/smoke_settings_com.py --build-dwt). Never refuses; it reads a catalogue.

Inputs: no named parameters. Returns: object

drawing_template_saveSave As TemplateA

AutoCAD's SAVEAS → Drawing Template, on both engines.

Live AutoCAD writes a real .dwt (SaveAs(path, ac2018_Template)) and puts description into the template's summary Comments; the active document is rebound to the new file, as SAVEAS does. Headlessly a .dxf template is written — drawing_new(template=<path>) opens it — and a .dwt request is refused with capability dwt_write (the message names the DXF route and the COM route); a description is reported description_written: false because DXF has nowhere to keep it. Any other suffix, and any path outside the allowed directories, is refused before a byte is written.

Pack: core · lean: no (drawing_save_as is not lean either).

Inputs: path (required), name, description. Returns: object

drawing_topology_checkDrawing: Topology CheckA
Read-only

Topology of a line network (spec §11): dangling ends, near misses (end to end and end to line within gap) and interior crossings (two lines of one layer crossing away from their ends). Never modifies the drawing.

An end that touches another network line, any curve on another layer (a tank outline) or the box of any block reference (a valve, a pump) is connected. Arcs and bulged polyline segments are measured as true arcs; arcs are not tested for crossings. The default layers come with their classification as evidence.

Refused before any work: a path that does not exist or cannot be read, a layers entry that is not a layer of the drawing (the drawing's layers named), no layer classified as a network layer when layers is omitted (name them), a non-positive tol or gap, and a gap that does not exceed tol.

Inputs: gap, tol, path, limit, +1 more. Returns: object

drawing_understandUnderstand: Describe DrawingA
Read-only

One report on a drawing somebody else made, every claim with its evidence and a confidence. Never modifies the drawing: a file is read as it is, and the current document through a snapshot (headless: the document in memory; live: a Document.Export DXF copy in a temporary folder, deleted after). An xref's own entities are not read - the host drawing is.

  • units: $INSUNITS as declared against the unit the geometry implies (text heights, wall thickness, door swings, labelled room areas, overall size - each item with its median and its value under every candidate unit). A disagreement is a warning with the numbers, never a silent correction.

  • extents: declared, computed and robust boxes and the outliers that stretch them, farthest first, by handle.

  • clusters: separate bodies of model-space content (plan copies, sheets, details), each with its box, entity count, commonest layers and tallest labels.

  • layers: entity count, drawn length (and metres in the inferred unit) and the discipline / service each most likely carries - the vocabulary's confidence (0.9) for a name keyword, 0.6 when most texts on the layer agree, 0.4 when fewer do.

  • equipment_tags (a tag found more than once is ambiguous), rooms (room labels in five languages, each with the wall-layer face it sits in and its measured area), languages (Latin / Turkish / Cyrillic character classes), blocks (named / anonymous, kinds by name), layouts, title_block and warnings.

Refused before anything is read: a path that does not exist, a DXF over MAX_DXF_BYTES (the refusal names the size and the variable), and a file the engine cannot parse (a DWG headlessly: ezdxf reads DXF only).

Inputs: path. Returns: object

drawing_undoUndoA

Undo the last drawing operation.

On the live COM backend this is AutoCAD's own undo. The headless backend has no journal, so a step is a full DXF snapshot and history is off by default — set EZDXF_UNDO_DEPTH to the number of steps you want. Measured cost of switching it on: 37x on entity creation (0.18 -> 6.65 ms per call). For a single checkpoint around a risky sequence, transaction_begin / transaction_rollback is far cheaper.

Drawing something after an undo discards the redo branch, as in AutoCAD.

Inputs: no named parameters. Returns: object

drawing_verify_requirementsUnderstand: Verify RequirementsA

Measure source requirements on the CAD geometry and say, per requirement, pass / fail / unknown / unsupported / ambiguous - with the evidence.

Each requirement is bound to the real feature (by handle, feature tag, arch element, geometric predicate or DIMENSION; two equal candidates are ambiguous, never a pick) and measured on the geometry read from the drawing

  • never on a label, a stored model or the numbers that were typed in. A row gives target, measured, delta, tolerance basis, status, handles and source; counts gives the denominators (required = pass + fail + unknown + unsupported + ambiguous). status is pass only when every requirement passes; accepted also needs fresh evidence and no dimension_mismatch finding (a DIMENSION whose text or DIMLFAC disagrees with the geometry).

Modes:

  • requirements ({"units": ..., "items": [typed requirements]}, or a legacy {"dimensions": {...}} that is carried read-only and verifies nothing) or use_stored=True: measured on the current document. evidence records its id and content revision; a later revision makes the report stale.

  • artifact_path: measured on that saved file, read fresh (a .dwg on a live seat through a private copy), each feature re-bound from the current document - by handle while handles are stable, then by feature tag, then by geometry, two candidates being unknown - with rebinding and the before / after comparison in the report. A count or absence is counted afresh on the file, never carried over; a DIMENSION not found again there is a blocking dimension_unverified finding. provenance says whether the current document can be the file's source (at least half of the entities match unchanged); when not, a blocking artifact_source_mismatch finding, no comparison, and a handle-naming requirement is unknown.

  • manifest_path: re-hashes a drawing_deliver bundle and lists every artifact whose sha256 no longer matches (stale) or that is gone (missing).

report_path writes the report as JSON (.json) or Markdown (.md); nothing else is written, and the drawing never is.

Refused before any work: requirements together with use_stored (invalid_args); neither of them without manifest_path (missing_requirement); use_stored on a drawing that stores no requirements (missing_requirement); requirements that do not parse (invalid_args, the offending path named); a binding_policy other than strict / lenient; manifest_path together with requirements, use_stored or artifact_path; an artifact_path or manifest_path that does not exist; a manifest that is not a delivery manifest; a report_path not ending in .json or .md (only .json in manifest mode); a DWG artifact on the headless engine (capability dwg). A quarantined document is refused.

Inputs: use_stored, report_path, requirements, artifact_path, +2 more. Returns: object

entity_array_polarPolar ArrayA

Create a polar (circular) array of copies around a center point.

count is unbounded, so the same result-shaping applies as for the rectangular array: fields=["handle"] when the geometry is already known.

Inputs: count (required), handle (required), center_x (required), center_y (required), +3 more. Returns: result

entity_array_rectangularRectangular ArrayA

Create a rectangular array of copies. Returns info of all created copies.

rows x cols is unbounded, so this is a result-heavy tool despite being a create: a 40x40 grid hands back 1600 full records. fields=["handle"] is usually all a caller needs from it.

Inputs: cols (required), rows (required), handle (required), col_spacing (required), +3 more. Returns: result

entity_batch_createBatch Create EntitiesA

Create multiple entities in a single call for better performance.

Each entity dict must have a 'type' key and the parameters for that type. Example: [{"type": "line", "x1": 0, "y1": 0, "x2": 100, "y2": 0}, {"type": "circle", "cx": 50, "cy": 50, "radius": 25}]

Denser than cad_batch for many entities of the same kind (no per-step tool name), and usable as one step of a cad_batch. Use cad_batch when the calls differ, must be ordered, or must feed each other.

Inputs: entities (required). Returns: object

entity_batch_modifyBatch Modify EntitiesA

Apply multiple modifications in a single call.

Example: [{"handle": "1A", "action": "move", "dx": 10, "dy": 20}, {"handle": "2B", "action": "delete"}]

Covers move/rotate/scale/delete/set_properties only. For anything else, for ordering, or to feed one step's result into the next, use cad_batch.

Inputs: operations (required). Returns: object

entity_chamferChamfer Two EntitiesA

Bevel a corner with a chamfer line. Returns info on the new chamfer LINE. V1 supports LINE+LINE only.

Inputs: dist1 (required), handle1 (required), handle2 (required), trim, +1 more. Returns: object

entity_change_spaceChange SpaceA

AutoCAD's CHSPACE: move entities across spaces, rescaled by the viewport.

Geometry is transformed by the viewport's own matrix so it stays the same size on screen — a move without that transform would leave a 100 mm feature as 100 mm of paper inside a 1:2 viewport.

Refused per entity for dimensions (unless freeze_dimensions), ACIS solids, tables and proxies, viewports, and entities already in the target space; refused outright for a twisted or non-plan viewport. Entities that end up outside the viewport or off the sheet are moved and flagged, not refused.

Inputs: handles (required), viewport_handle (required), direction, freeze_dimensions. Returns: object

entity_copyCopy EntityA

Copy an entity and move the copy by (dx, dy, dz). Returns info of the new copy.

Inputs: dx (required), dy (required), handle (required), dz. Returns: object

entity_create_arcCreate ArcA

Create a circular arc. Angles are in degrees, measured counter-clockwise from the positive X axis.

Inputs: cx (required), cy (required), radius (required), end_angle (required), +3 more. Returns: object

entity_create_block_refInsert Block ReferenceA

Insert a block reference (instance of an existing block definition).

Refused before any write, on both engines: a name that is not a block definition in this drawing (block 'X' is not defined — check block_list), a layout block (*Model_Space / *Paper_Space, a reference cycle) and a non-string name. The same gate as block_insert; this tool is the no-attributes form.

Inputs: x (required), y (required), name (required), layer, +3 more. Returns: object

entity_create_circleCreate CircleA

Create a circle at (cx, cy) with given radius.

Inputs: cx (required), cy (required), radius (required), color, +1 more. Returns: object

entity_create_ellipseCreate EllipseA

Create an ellipse. major_x/major_y define the major axis vector from the center.

Inputs: cx (required), cy (required), major_x (required), major_y (required), +3 more. Returns: object

entity_create_hatchCreate HatchB

Create a hatch fill pattern inside a closed boundary polygon.

Inputs: pattern (required), boundary_points (required), angle, color, +2 more. Returns: object

entity_create_lineCreate LineA

Create a line from (x1,y1) to (x2,y2). Returns entity info with handle.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +5 more. Returns: object

entity_create_mtextCreate MTextA

Create a multi-line text entity (MTEXT) with word-wrap at the specified width.

Inputs: x (required), y (required), text (required), color, +4 more. Returns: object

entity_create_pointCreate PointB

Create a point marker entity at (x, y).

Inputs: x (required), y (required), color, layer. Returns: object

entity_create_polylineCreate PolylineA

Create a lightweight 2D polyline through the given points.

Example: points=[[0,0],[100,0],[100,100],[0,100]], closed=true → rectangle

Inputs: points (required), color, layer, closed. Returns: object

entity_create_rectangleCreate RectangleA

Create a closed rectangular polyline between two corner points.

Convenience wrapper around entity_create_polyline.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +2 more. Returns: object

entity_create_revcloudCreate Revision CloudA

Draw a revision cloud: a polyline whose every segment carries an arc.

A segment_length longer than the shortest edge is refused — the result would carry no arcs at all and would be a plain polyline reported as a cloud.

Inputs: points (required), segment_length (required), layer, closed. Returns: object

entity_create_splineCreate SplineA

Create a NURBS spline curve passing through the specified fit points.

Inputs: fit_points (required), color, layer. Returns: object

entity_create_tableCreate TableB

Create a native COM table or an explicitly-labelled ezdxf composite table.

Inputs: x (required), y (required), rows (required), layer, +5 more. Returns: object

entity_create_textCreate TextA

Create a single-line text entity (DTEXT/TEXT).

Inputs: x (required), y (required), text (required), color, +3 more. Returns: object

entity_create_wipeoutCreate WipeoutA

Create a WIPEOUT that hides drawing content behind its outline.

Refuses fewer than three points: a zero-area mask hides nothing while reporting success.

Inputs: points (required), layer. Returns: object

entity_deleteDelete EntityA
Destructive

Permanently delete an entity by its handle.

Inputs: handle (required). Returns: object

entity_delete_manyDelete Multiple EntitiesA
Destructive

Delete multiple entities in one call. Returns count of deleted entities.

Inputs: handles (required). Returns: object

entity_edit_geometryEdit GeometryA

Edit the defining geometry of an existing entity in place (no delete/recreate).

CIRCLE: cx/cy/radius · LINE: x1/y1/x2/y2 · ARC: cx/cy/radius/start_angle/end_angle. Any argument left out is unchanged; the handle is preserved.

Inputs: handle (required), cx, cy, x1, +6 more. Returns: object

entity_edit_textEdit TextA

Edit an existing text label in place — change its content, height, or rotation.

Use this to rename/relabel without deleting and recreating (which would lose the handle). Works on both TEXT and MTEXT.

Inputs: handle (required), text, height, rotation. Returns: object

entity_extendExtend EntityA

Extend target to meet boundary. If end_x/end_y is None, the target endpoint nearest the boundary is auto-selected.

V1 supports LINE+LINE only. Raises if the lines are parallel.

Inputs: target_handle (required), boundary_handle (required), end_x, end_y. Returns: object

entity_filletFillet Two EntitiesA

Round a corner with a tangent arc. Returns info on the new ARC entity (or the first source line for radius=0). V1 supports LINE+LINE only.

Inputs: radius (required), handle1 (required), handle2 (required), trim. Returns: object

entity_getGet EntityA
Read-only

Get all properties of a specific entity by its handle.

Coordinates are WCS. A HATCH also reports every boundary loop: loops (each with kind, flags, depth, points and the parallel bulges, edges for an edge path, exact and its area), hatch_style and the filled area - outer loops minus islands by the hatch's own island style, the rule analysis_measure_entity applies; None when a loop has an ellipse or spline edge. A DIMENSION also reports dimension: dimtype, the five defpoints, its own measurement (before DIMLFAC), text_override, dimstyle, dimlfac and angle. On the live engine those two are read from the drawing's DXF export (one export per call; detail_source says so), and a member of a block definition reports detail_unavailable. An entity in a plane tilted out of WCS XY reports plane_normal (or tilted) and omits what xy cannot express. Refused: a handle the drawing does not hold.

Inputs: handle (required). Returns: object

entity_get_xdataGet Entity XDATAC
Read-only

Extended entity data as {app: [values]}. An app with no XDATA is simply absent.

Inputs: handle (required), app_name. Returns: object

entity_listList EntitiesA
Read-only

List entities in the drawing with optional type and layer filters.

Returns handle, type, layer, color, and type-specific properties. Use handles with entity_get, entity_move, entity_delete, etc.

This is the most expensive result on the server — the full record runs ~250 characters per entity, and properties.bounding_box alone is about a third of it. When all you need is handles, say so::

entity_list(layer_filter="GEOMETRY", fields=["handle", "type"], compact=True)

Paging honesty: a plain list has nowhere to say that more entities followed the page, so compact=True is the only mode that reports total, truncated and next_offset — all measured against the same filters.

Inputs: limit, fields, offset, compact, +2 more. Returns: result

entity_mirrorMirror EntityA

Mirror an entity across a line defined by two points. Returns the mirrored copy.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +2 more. Returns: object

entity_moveMove EntityA

Move an entity by the specified displacement vector (dx, dy, dz).

Inputs: dx (required), dy (required), handle (required), dz. Returns: object

entity_offsetOffset EntityB

Create a parallel copy of a line, circle, or polyline at the given distance.

Inputs: handle (required), distance (required), side_x, side_y. Returns: object

entity_rotateRotate EntityA

Rotate an entity around a base point by the specified angle.

Inputs: base_x (required), base_y (required), handle (required), angle_deg (required). Returns: object

entity_scaleScale EntityA

Scale an entity uniformly from a base point.

Inputs: base_x (required), base_y (required), factor (required), handle (required). Returns: object

entity_select_smartEntity: Smart Select (semantic predicate)A
Read-only

Select entities by semantic predicate instead of memorising handles.

Uncapped. The usual next step is dimension_auto(handles), so fields=["handle"] is normally all this needs to return.

Inputs: predicate (required), fields, compact. Returns: result

entity_set_propertiesSet Entity PropertiesA

Change one or more properties of an entity (layer, color, linetype, lineweight, visibility).

Inputs: handle (required), color, layer, visible, +2 more. Returns: object

entity_set_xdataSet Entity XDATAA

Replace the named app's XDATA on one entity; an empty list removes it.

Limits are AutoCAD's and are enforced before writing: 255 characters per string and 16 KB per entity.

Inputs: handle (required), values (required), app_name (required). Returns: object

entity_trimTrim EntityA

Trim target against cutter, keeping the segment containing (keep_x, keep_y).

V1 supports LINE+LINE only. Cutter is treated as an infinite ray (AutoCAD's default 'implied extend' trim mode). Raises if the lines are parallel.

Inputs: keep_x (required), keep_y (required), cutter_handle (required), target_handle (required). Returns: object

gd_frameGD&T: Feature Control Frame (ISO 1101)A

Draw an ISO 1101 feature control frame from LINE + TEXT primitives.

Renders identically on COM and ezdxf. Referenced datums are recorded so the gdt critique focus flags any datum with no matching datum feature.

Inputs: x (required), y (required), symbol (required), tolerance (required), +5 more. Returns: object

gear_draw_helical_front_viewGear: Helical Front ViewA

Deterministic helical gear front view: full involute outline (40 pts/flank), pitch/base/outer/root circles, helix symbol, optional bore + keyway.

Returns a handle bundle plus 'metadata' for downstream gear_draw_section_aa.

Inputs: teeth (required), module (required), helix_angle (required), hand, +6 more. Returns: object

gear_draw_section_aaGear: Section A-A ViewA

Deterministic side cross-section of a gear created by gear_draw_*_front_view. Includes top/bottom/left/right boundaries, bore lines, keyway notch, ANSI31 hatch.

Inputs: x_offset (required), face_width (required), gear_metadata (required). Returns: object

gear_draw_spur_front_viewGear: Spur Front ViewB

Deterministic spur gear front view (no helix symbol).

Inputs: teeth (required), module (required), center_x, center_y, +4 more. Returns: object

hatch_add_boundaryAdd Hatch BoundaryA

Add one boundary path built from typed edges - an island inside the hatch.

Typed edges exist because a boundary that only accepts vertex lists silently straightens every curve it is given. Every edge is validated before any is written, so a malformed list refuses instead of leaving a half-built path. Both engines: headlessly the edges become an edge path; on a live seat each becomes a temporary LINE, true ARC or ELLIPSE appended as an inner loop and then deleted (a chain of lines becomes one polyline). A loop that does not close is refused by AutoCAD and nothing is added.

Inputs: edges (required), handle (required). Returns: object

hatch_editEdit HatchA

Edit an existing hatch in place.

Omitted parameters are left alone — a partial edit that resets the rest is data loss. changed reports which attributes actually moved, so re-setting a value to what it already was comes back as an empty list rather than a false positive.

Inputs: handle (required), angle, color, scale, +2 more. Returns: object

hatch_materialMaterial Hatch (ISO 128-50)A

Section-hatch a cut face with the pattern ISO 128-50 gives its material.

Refusals: an unknown material (named, with the full list, before anything is drawn), neither boundary nor handles (or both), a boundary with fewer than three points, and a non-positive scale. With handles the loop is chained by boundary_from_entities, which the COM engine refuses (capability boundary_trace) - pass boundary on a live seat, or run headlessly. The HATCH layer is created first when the drawing lacks it: ActiveX refuses an entity on an absent layer and would otherwise leave the hatch orphaned on layer 0.

The payload states its own accuracy, as analysis_measure_entity does: area is the polygon actually hatched, boundary_area the exact area of the chained loop, and accuracy is "exact" or "flatten_tolerance" - an arc edge reaches entity_create_hatch as chords, so a curved cut face is hatched to within HATCH_FLATTEN_SAGITTA of itself rather than being replaced by its chord polygon. With handles, the outline boundary_from_entities draws is scaffolding and is deleted; traced reports its handle and whether the delete succeeded. A loop enclosing no area is refused instead of writing a HATCH of area 0.0.

Inputs: angle, layer, scale, handles, +2 more. Returns: object

hatch_set_gradientSet Hatch GradientA

Fill a hatch with a gradient instead of a pattern.

Inputs: color1 (required), color2 (required), handle (required), name, +4 more. Returns: object

image_attachSheet: Attach ImageA

Attach a raster underlay at the file's own aspect ratio. Both engines.

scale is drawing units per pixel, so the placed size is the image's pixel size times scale and the payload reports both. Refusals, all before anything is written: a file that does not exist, a file no image reader can open (named), a non-positive or non-finite scale.

Inputs: path (required), x, y, scale, +1 more. Returns: object

keyway_draw_keyed_boreKeyway: Keyed Bore (front view)A

Bore + DIN 6885 keyway in front view. Auto-sizes keyway from bore if width/depth omitted.

Inputs: center_x (required), center_y (required), bore_diameter (required), layer, +2 more. Returns: object

keyway_draw_sectionKeyway: Side SectionC

Side cross-section view of a keyed bore.

Inputs: center_x (required), center_y (required), face_width (required), bore_diameter (required), +2 more. Returns: object

layer_createCreate LayerB

Create a new layer with specified properties.

Inputs: name (required), color, linetype, lineweight. Returns: object

layer_deleteDelete LayerA
Destructive

Delete a layer. The layer must have no entities. Layer '0' cannot be deleted.

Inputs: name (required). Returns: object

layer_freezeFreeze LayerA

Freeze a layer (makes it invisible and unselectable, faster regeneration).

Inputs: name (required). Returns: object

layer_hideHide LayerA

Turn off a layer (entities invisible but still processed in regeneration).

Inputs: name (required). Returns: object

layer_isolateIsolate LayerA

Hide all layers except the specified one (layer isolation).

Inputs: name (required). Returns: object

layer_listList LayersA
Read-only

List all layers with their properties (color, linetype, frozen, locked, visibility).

Never truncated — a drawing's whole layer table is returned — so a compact envelope here always reports truncated=false.

Inputs: fields, compact. Returns: result

layer_lockLock LayerA

Lock a layer (entities visible but cannot be selected or modified).

Inputs: name (required). Returns: object

layer_modifyModify LayerA

Modify an existing layer's color, linetype, and/or lineweight.

Inputs: name (required), color, linetype, lineweight. Returns: object

layer_set_currentSet Current LayerA

Set the active/current layer for new entities.

Inputs: name (required). Returns: object

layer_showShow LayerA

Turn on a layer that was previously turned off.

Inputs: name (required). Returns: object

layer_state_deleteDelete Layer StateA
Destructive

Remove the named state's XRECORD. Layers themselves are untouched. Refusal: an unknown name (lists the saved ones). Pack: settings · lean: no.

Inputs: name (required). Returns: object

layer_state_listList Layer StatesA
Read-only

Every state under ACADMCP_LAYERSTATES with its description and layer count. These are the server's portable states, not AutoCAD Layer States Manager entries. No refusals. Pack: settings · lean: no.

Inputs: no named parameters. Returns: object

layer_state_restoreRestore Layer StateA

Apply a saved state to the layers that still exist.

missing_layers (in the state, not in the drawing) are skipped, never created; new_layers (in the drawing, not in the state) are untouched; applied says how many layers and which properties moved. Refusals: an unknown state name (lists the saved ones), a property outside the eight (names the index). Live, a layer AutoCAD refuses to change (freezing the active layer, making a frozen layer current) lands in warnings instead of failing the call; the state's current layer is thawed before it is made current when frozen is being restored, so save → freeze → restore round-trips. Portable server states, not Layer States Manager entries. Pack: settings · lean: no.

Inputs: name (required), properties. Returns: object

layer_state_saveSave Layer StateA

Snapshot every layer's on/frozen/locked/color/linetype/lineweight/plot flags plus the current layer as a named state stored in the drawing.

These are the server's own portable layer states: JSON chunks in an XRECORD under the ACADMCP_LAYERSTATES dictionary. They live in the file and travel with it, work on both engines, and do not appear in AutoCAD's Layer States Manager (LAYERSTATE). Same name replaces (replaced: true). Refusals: an empty or control-character name, a non-string description. Pack: settings · lean: no.

Inputs: name (required), description. Returns: object

layer_thawThaw LayerA

Thaw a frozen layer, making it visible and selectable again.

Inputs: name (required). Returns: object

layer_unlockUnlock LayerA

Unlock a layer to allow entity selection and modification.

Inputs: name (required). Returns: object

layout_copyCopy LayoutA

Copy a paper-space layout: page setup, plot settings and all geometry.

skipped names any DXF types that could not be cloned — check it rather than trusting ok alone. Associative hatch boundaries are re-pointed at the cloned entities; associativity_dropped counts those that referenced something outside the source layout and had to be cleared.

Inputs: source (required), new_name (required). Returns: object

layout_createCreate LayoutA

Create a new paper-space layout tab.

Inputs: name (required). Returns: object

layout_deleteDelete LayoutA
Destructive

Delete a paper-space layout and every entity on it.

Refuses model space, a blank name, and the last remaining sheet. If the deleted tab was the current one, the returned current is where geometry goes next — and handles from the deleted sheet stop resolving.

Inputs: name (required). Returns: object

layout_listList LayoutsA
Read-only

List all layout tabs (Model + paper-space layouts) and the current one.

Inputs: no named parameters. Returns: object

layout_renameRename LayoutA

Rename a paper-space layout. Entity handles are unaffected.

Inputs: new_name (required), old_name (required). Returns: object

layout_set_currentSet Current LayoutB

Activate a layout tab.

Inputs: name (required). Returns: object

leader_create_mleaderCreate MultileaderC

Create a native COM MLeader or an explicitly-labelled ezdxf composite.

Inputs: text (required), points (required), layer, arrow_size, +2 more. Returns: object

linetype_listList Loaded LinetypesA
Read-only

Return the names of all linetypes currently loaded in the active drawing.

Inputs: no named parameters. Returns: result

linetype_loadLoad LinetypeA

Load a single linetype safely.

Use this instead of system_run_command('_-LINETYPE _LOAD ...') — that raw form deadlocks on the FILEDIA file-picker dialog and on the -LINETYPE option-menu prompt (measured on AutoCAD 2026: it loads nothing either way). This tool loads through the ActiveX Linetypes.Load member, picks the right .lin file from MEASUREMENT, and verifies the linetype actually loaded. Refuses a name that is not a valid symbol name, a file outside the allowed paths, and reports a name the file does not carry or a file AutoCAD cannot find as an error naming both.

Inputs: name (required), file. Returns: object

mech_dimension_partMechanical: Dimension PartA

Every dimension the part and its features ask for, laid out without overlaps.

Axial lengths are chained, stacked from a baseline or measured from an origin; diameters stack outside the silhouette; fillets get a radius. Each measurement appears once (ISO 129-1): every view record carries a dimensioned flag, so after a mech_part_draw that dimensioned the front view and a mech_view_add, this call dimensions only the new view, and views naming a view already dimensioned is refused by name. fits resolves an ISO 286 code against the measured nominal through the repository's authored tables and appends the code to the dimension text; an explicit tol on a feature's own intent does the same through the ISO 129 path.

Refused by name: a fit together with an explicit tolerance, a fit outside the authored ISO 286 range (over 1 mm to 500 mm, IT4-IT11), a fit on an intent with no measurable nominal, an unknown style, an unknown part_id, a call when every view is already dimensioned (the message lists them), and part_id=None on a drawing that holds more than one part. An angular intent is reported in skipped rather than drawn, because a DimIntent carries no vertex.

Inputs: fits, style, views, part_id, +1 more. Returns: object

mech_hole_patternMechanical: Hole PatternA

A hole pattern on any drawing - the part model is not required.

The same expansion HolePattern performs inside a part, exposed for a drawing that was not built from the model.

Refused before anything is drawn: an unknown pattern, a count below 1 (below 2 for polar), a linear pattern with no spacing, a grid with more than one column or row and no pitch for it, a polar pattern with no pitch-circle diameter, and a non-finite or non-positive diameter.

Inputs: x (required), y (required), pattern (required), diameter (required), +10 more. Returns: object

mech_part_drawMechanical: Draw PartA

One part model - a turned profile or a plate outline plus typed features - drawn as views.

The model is written onto the drawing as ACADMCP_MECH XDATA on an anchor POINT, so mech_view_add can add a section months later without the caller re-describing the part, and mech_part_inspect reads it back.

Refused before anything is drawn, by path: a non-finite or non-positive number (segments[2].d_outer), a bore that is not smaller than its outside, an outline with fewer than three distinct vertices or one that crosses itself, an unknown material, a feature whose placement is off the part, two features that would remove the same material (both names given), a thread outside the transcribed ISO 261 table, a keyway outside DIN 6885's bore range, gear teeth whose tip diameter disagrees with their segment. A DIN 509 undercut, a DIN 471/472 groove, a DIN 332 centre hole and an ISO 3601-2 O-ring groove need explicit dimensions in this build: those tables are not transcribed and the lookup refuses by name rather than interpolate. A feature that cannot be projected into a requested view is listed in omitted, never dropped.

Inputs: spec (required), at_x, at_y, style, +4 more. Returns: object

mech_part_from_specMechanical: Sheet From SpecA

Several parts, their views and their dimensions, drawn inside one transaction.

Every part is validated before the transaction opens, so a refusal leaves the drawing untouched and names the offending path (parts[1]: segments[0].d_outer: ...). If a draw fails or the request is cancelled part-way, the transaction is rolled back under an anyio shield, so a cancelled call cannot leave half a sheet inside an open transaction.

Refused by name: an empty parts list, any part refusal from mech_part_draw, and a transaction that cannot be opened.

Inputs: spec (required). Returns: object

mech_part_inspectMechanical: Inspect PartA
Read-only

The ACADMCP_MECH payload a drawn part carries, decoded.

Never modifies the drawing. Returns the part model exactly as mech_part_draw accepts it (part), the views drawn so far with their placements, and the payload version.

Refused by name: an unknown part_id, a handle that carries no ACADMCP_MECH payload, a corrupt or foreign payload, and part_id=None on a drawing that holds no part or more than one (the message lists the handles).

Inputs: part_id. Returns: object

mech_view_addMechanical: Add ViewA

Another view of a part already on the drawing, laid out on its projection axis.

The part model comes back out of the drawing's ACADMCP_MECH XDATA, so the caller never re-describes it, and the placement follows the projection angle recorded when the part was drawn (first angle by default: the view from the right goes to the left).

Refused by name: a section without a plane, or with a plane of zero length, a plane that misses the part, or one that grazes an outline vertex so its crossings cannot be paired; a half or offset section on the wrong kind of plane (the message names the style that does apply); a detail without a radius or with a scale of zero; an unknown part_id, and part_id=None on a drawing that holds more than one part.

Inputs: gap, kind, side, plane, +4 more. Returns: object

mleaderstyle_createStyles: Create Multileader StyleA

Create a multileader style: preset values first, then overrides.

Headless it lands on doc.mleader_styles; live it is added through the ACAD_MLEADERSTYLE dictionary (AddObject(name, "AcDbMLeaderStyle")) and the object's properties are written. Refuses, before any write: an unknown preset; an override key outside the four; arrow_size / text_height <= 0, landing_gap < 0; a name that exists; a text_style that is neither present nor a bundled preset (ISOCP, ISOCPEUR, ARIAL, ROMANS — those are created on both engines, textstyle_created; live, a preset whose font file the seat lacks is refused, nothing written).

Inputs: name (required), preset (required), overrides. Returns: object

mleaderstyle_listStyles: List Multileader StylesA
Read-only

Every MLEADERSTYLE with its four values on both engines (values_available: true). Headless they are read from the MLEADERSTYLE object; live from the AcadMLeaderStyle objects the ACAD_MLEADERSTYLE dictionary holds (ActiveX exposes no collection property for them, but the dictionary items are full objects). leader_create_mleader can still override any of them per leader.

Inputs: no named parameters. Returns: object

page_setup_applyApply Page SetupA

AutoCAD's PAGESETUP as one call, on both engines.

Paper sizes are ISO 216 / ANSI Y14.1; the media is written in AutoCAD's own spelling (ISO_A3_(420.00_x_297.00_MM)). changed lists only the values that moved — re-applying the same setup reports {}. An unknown ctb is written and reported plot_style_known: false (a missing ctb only matters at plot time). Viewports on the sheet are never touched.

Refused before anything is written: an unknown paper, orientation, scale or plot_area, an empty device or plot_style, margins that leave no printable area, Model, an unknown layout. On the live engine margins_mm is refused (the .pc3 owns them) and a media the device does not offer is refused with the device's names for the same paper.

The proof is the PDF: batch_plot reads each sheet's /MediaBox back.

Inputs: paper (required), layout (required), scale, center, +5 more. Returns: object

page_setup_listList Page SetupsA
Read-only

The page setup stored on each paper-space layout.

paper is the catalogue name (ISO_A3, ANSI_B, …) when the stored size matches one within 0.5 mm, otherwise the media name as stored; size_mm, orientation, plot_style (ctb), scale ("fit", "1:50", or a custom ratio), plot_area, device, margins_mm [top, bottom, left, right] and center are read back from the LAYOUT object (headless) or the AutoCAD Layout (live). Refuses an unknown layout name and Model (model space has no sheet; plot it with drawing_export_pdf(layout=None)).

Inputs: layout. Returns: object

pid_equipment_listP&ID: Equipment ListA

Every equipment, valve and connector node with its ports and how many lines reach them.

Rows come from pid_graph; the drawing is not modified and csv_path is the only file this tool writes, validated before the drawing is read.

Inputs: scope, csv_path, tolerance, label_search, +1 more. Returns: object

pid_from_specP&ID: From SpecA

Equipment, valves, instruments and connectors placed, then every line drawn port-to-port, inside one transaction: any bad item rolls the whole sheet back and the error names it (lines[2].to); so does an interruption (a client cancellation mid-run leaves no half-drawn sheet and no open transaction on either engine — the live one goes back to the UNDO Mark transaction_begin set, so it never waits at an AutoCAD prompt; should that rollback itself fail, the failure is logged, the cancellation is what the client sees, and the drawing must be checked before a retry). A non-finite coordinate, rotation, scale or stub is refused by path before anything is placed. The response carries the graph read back from the drawing and the P&ID critique issues, so the caller sees dangling ends or duplicate tags in the same round trip. dry_run returns the planned vertices and crossings without touching the drawing; crossings are counted, on both runs, against the spec's own lines and the P&ID lines already on the current layout (crossings_scope). The dry run also returns the routing region and a preview whose precondition is the fingerprint of every entity in that region. Applied with the preview's revision (expected_revision) and/or preconditions, the run is refused with kind stale_revision and nothing drawn when anything in the region (or the revision) changed; a region precondition taken from another spec is refused by path. A guarded run reports revision ({checked, after, interleaved}).

Inputs: spec (required), dry_run, preconditions, expected_revision. Returns: object

pid_graphP&ID: Connectivity GraphA
Read-only

Connectivity of the drawing as it is, not as it was drawn.

Nodes: symbol INSERTs classified by catalogue name (confidence 1.0), ACADMCP_PID payload (0.95), tag attributes / block-name keywords (0.6) or a line touching an unknown INSERT (0.3); every node reports its source. Ports come from the INSERT's real rotation, scale and mirror, measured (a stretched bubble drops the node to 0.6 with a note). Edges: lines and polylines; each end resolves to a port, a junction on another line, or dangling with the nearest port as a hint — always within its own space, so scope="all" never joins two sheets. stats.confidence_min is the number to read before trusting a foreign drawing.

Returns nodes, edges, junctions, dangling, unclassified, offpage_links, stats, tolerance, scope and backend:

  • node: id, kind, block_name, family, symbol, tag, tag_parsed, tag_source, x, y, rotation_deg, scale, y_scale, mirrored, layer, space, description (its DESC attribute), source, confidence, notes, and ports {name, x, y, direction_deg, kind, radius, inferred, edges};

  • edge: id, line_class, class_source, line_number, number_source, size, service, spec, insulation, from, to, length (plus length_approximate when the engine measured none), layer, space, source; vertices and bulges with include_geometry;

  • junction: id, x, y, edges, space; dangling: edge, end, x, y, nearest.

Inputs: scope, tolerance, label_search, include_foreign, +1 more. Returns: object

pid_instrument_indexP&ID: Instrument IndexA

Every instrument bubble with its ISA-5.1 reading and what it connects to.

Rows come from pid_graph, never from typed-in lists; the drawing is not modified. csv_path is the only file this tool writes (so it is not annotated read-only); it is validated before the drawing is read, and an empty path, a directory or a missing parent folder is refused. signal_lines counts ISA-5.1 signal lines only; connected_to names a tag, a handle, or the lines a junction on the instrument's line joins.

Inputs: scope, csv_path, tolerance, label_search, +1 more. Returns: object

pid_line_drawP&ID: Draw LineA

Connect two ports with one LWPOLYLINE on the class's layer.

Ports come from pid_symbol_insert; a bubble's radial port is entered without a name. auto picks the shortest orthogonal route that leaves each port straight for stub mm; when none exists the call refuses and says so — pass waypoints. crossings counts existing P&ID lines the new one cuts (reported, never refused) and port_reuse names ports that already had a line (branching is legal). Signal classes get ISA-5.1 markers (//, X, L, o) as small blocks on segments >= 15 mm; electric is dashed by layer. A signal line carries no pipe line number: it gets no auto-built number and no label, and does not consume the process sequence — a verbatim line_number is still written and labelled. With waypoints, a bubble's exit leaves towards the first waypoint (and the entry arrives from the last one); crossings follows existing arcs, not their chords.

Inputs: to (required), from_ (required), size, spec, +9 more. Returns: object

pid_line_listP&ID: Line ListA

Every P&ID line with its number, class, size/service/spec/insulation and endpoints.

Rows come from pid_graph; untagged lines sort last with line_number: null. An end names a node's tag (its handle when untagged) and port, or — at a junction — the line numbers (or handles) of the lines it joins. The drawing is not modified; csv_path is the only file this tool writes, validated before the drawing is read.

Inputs: scope, csv_path, tolerance, label_search, +1 more. Returns: object

pid_symbol_insertP&ID: Insert SymbolA

Insert a catalogue symbol as a real block with TAG attributes and named ports.

Defines the block on first use (defined), creates a missing family layer from the P&ID layer set (layers_created), writes an ACADMCP_PID payload so readers without the catalogue still see the ports, and returns every port in WCS — connect them with pid_line_draw. An invalid ISA-5.1 tag is written and reported in tag_warnings; drawing_critique flags it.

Inputs: x (required), y (required), symbol (required), tag, +12 more. Returns: object

pid_symbol_listP&ID: Symbol CatalogueA
Read-only

The symbols pid_symbol_insert can place, with their ports and variant options.

Authored from ISO 10628-2 (equipment, valves) and ISA-5.1 (instrumentation); each row's source names the figure. Symbol-local sizes are millimetres at A3/A1 paper scale (bubble Ø10, valve 8×4); scale at insertion rescales.

Inputs: family. Returns: object

pid_tag_parseP&ID: Parse TagA
Read-only

ISA-5.1-2009 Table 4.1 as a grammar: first letter, modifier, readout and output functions, trailing high/low, loop number and suffix — with the standard's description ("Flow Indicating Controller") or the first offending letter. Equipment prefixes are not standardised, so the default map (P pump, V vessel, E exchanger, ...) can be replaced per call.

Inputs: tag (required), kind, equipment_prefixes. Returns: object

pipe_takeoffPlant: Pipe TakeoffA

A pipe takeoff: topology from the P&ID, lengths from the layout, rows by room x service x diameter.

The P&ID gives the runs (junctions merged, tees split, a line drawn twice counted once, valves and reducers bridged), each run's service (the layer, overridden by a supply / return word near the line), its diameters exactly as labelled (direct, carried by continuity - never across a reducer - or unassigned) and the equipment tags at its ends. The length comes from the layout unless the scale check calls the P&ID to scale: the rectilinear minimum spanning tree of the run's tag positions on the layout, each connection along x first then y, plus vertical_allowance per connection. The P&ID's drawn length stays beside it as schematic_m, never as the answer. Lengths are metres from the unit the geometry implies; an INSUNITS that disagrees is a warning, never a factor. Status A / B / C per run: a C run (an end on no equipment, a tag missing from or written twice on the layout) is on the Kontrol sheet with its schematic length, counted in the total and flagged.

Read-only on both drawings. With output it writes one workbook - Metraj, Özet, Kontrol, Metodoloji - as XLSX and, always, as CSV beside it.

Refused before a drawing is read: lang outside tr / en / ru, an unknown service or length source, an allowance outside 0-1, a negative vertical allowance, a non-positive tolerance, and length_source='layout' without a layout. A missing, unreadable or oversize drawing is refused by the reader, which names MAX_DXF_BYTES. Refused after the scale check: length_source='pid' on a P&ID it calls schematic, unless force=True (the refusal quotes the statistics). Without openpyxl the XLSX is not written and files.refused carries capability: "xlsx_write" naming the office extra; the CSV files are written all the same.

Inputs: tol, lang, force, layers, +8 more. Returns: object

plot_style_listList Plot StylesA
Read-only

The ctb files AutoCAD ships (monochrome.ctb, acad.ctb, Grayscale.ctb, the Screening set, …) and, on the live engine, the files actually present in Preferences.Files.PrinterStyleSheetPath (source: "installed", installed: true/false per row). Headlessly installed is null: there is no installation to scan, and the catalogue is not evidence of one. Never refuses; an unreadable Preferences object degrades to the catalogue.

Inputs: no named parameters. Returns: object

point_from_snapPoint: Snap (deterministic OSNAP)A
Read-only

Compute a deterministic snap point on an entity. Use this INSTEAD OF guessing coordinates — eliminates the most common LLM drawing error.

Inputs: snap (required), handle (required), ref_x, ref_y. Returns: object

point_intersectionPoint: Intersection (deterministic)A
Read-only

Compute the intersection of two geometry entities (LINE-LINE, LINE-CIRCLE, CIRCLE-CIRCLE). When two candidates exist, ref_x/ref_y selects the nearest.

Returns {x, y, on_first, on_second, on_both, candidates}. A LINE is intersected as the infinite line through it, so the point can lie beyond a drawn end: on_first / on_second say whether it lies on each drawn segment (a CIRCLE always holds its own intersection points) and on_both whether on both - check it before using the point as a corner. candidates is how many intersections existed. Refused, with the case named: parallel or coincident lines, a line that misses the circle, concentric circles, circles that do not meet, any other entity pair.

Inputs: handle1 (required), handle2 (required), ref_x, ref_y. Returns: object

point_tangentPoint: Tangent from external pointA
Read-only

Compute the tangent point on a circle from an external point. Returns {x, y}. Raises if the from-point is inside the circle.

Inputs: from_x (required), from_y (required), circle_handle (required), ref_x, +1 more. Returns: object

revision_addSheet: Add RevisionA

Append one row to the revision block, creating the block on first use.

Idempotent per revision code: a code the drawing already carries returns created=false and draws nothing, so re-running a revision pass cannot stack duplicates. The block defaults to the upper-right corner of the drawing frame, growing downwards, so it does not collide with the ISO 7573 parts list above the title block. Refusals, all before the first entity: a malformed code, a cloud region that is not [x0, y0, x1, y1], and any request for clouds on a backend whose revcloud capability is false (the COM engine — REVCLOUD has no ActiveX member) — that one carries capability: "revcloud".

Inputs: rev (required), description (required), by, date, +8 more. Returns: object

section_lineSection Line (ISO 128-40)A

Draw the cutting-plane line and hand back the plane a section view consumes.

Wide segments at the ends on GEOMETRY, the thin long-dash-dot middle on CENTER, an arrow at each end whose head sits on the line end and points the way the section is viewed, and the same letter beyond both arrows. payload["plane"] is exactly {p1, p2, label, direction, style} — feed it to the section view so the label on the plan and the label on the view cannot disagree. Refusals, before any entity is written: p1 == p2, a zero or parallel viewing direction, an empty label, a style outside full/half/offset/revolved, and a non-positive height.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +5 more. Returns: object

selection_filterSelect by PropertiesA
Read-only

AutoCAD's QSELECT: filter the drawing by properties.

Named parameters rather than a query string, deliberately — a mistyped attribute name in a query language comes back as an empty result, which is indistinguishable from "no matches". filtered_by reports which filters actually ran.

Inputs: color, layer, linetype, min_area, +1 more. Returns: object

selection_getGet Viewport SelectionA
Read-only

Read the entities the user pre-selected in the AutoCAD viewport (COM backend only).

Returns the implied "pickfirst" selection — the entities highlighted with grips before invoking the AI — so work can be scoped to exactly those entities instead of the whole drawing. Typical use::

sel = selection_get()
dimension_auto(sel["handles"], style="chain")

Result keys: ok — True on the COM backend (even for an empty selection) count — number of selected entities handles — list of entity handles (hex strings) to act on entities — full per-entity info (type, layer, color, ...) pickfirst — state of the PICKFIRST sysvar (None if unknown) message — guidance when nothing is selected

On the ezdxf headless backend there is no viewport, so this returns ok=False with an empty handles list.

fields / compact shape the "entities" collection — this tool already returns an object, so the columnar envelope lands under that key rather than replacing the result. handles is unaffected, so a caller that only wants handles can pass fields=["handle"] and still read handles directly.

Inputs: fields, compact. Returns: object

selection_polygonSelect by PolygonA
Read-only

Window or crossing selection against a polygon rather than a rectangle.

Inputs: points (required), mode, layer, entity_type. Returns: object

selection_windowSelect by WindowA
Read-only

AutoCAD's ssget window/crossing selection.

Corners may be given in any order. Selection is by drawn position, so an entity in a mirrored frame is found where entity_get reports it. A zero-area box is refused rather than answered with an empty list.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +3 more. Returns: object

sheet_frameSheet: ISO 5457 FrameA

ISO 5457 drawing frame for A4-A0: a 20 mm filing margin, 10 mm on the other three edges, the grid reference system and the centring/trimming marks.

Borders, rules and marks land on TITLEBLOCK; the zone lettering on TEXT. Refusals, all before the first entity is drawn: a size outside A4-A0 is refused by name and the five covered sizes are listed; an orientation that is neither 'landscape' nor 'portrait'; a layout that does not exist. The zone divisions drawn are equal -- ISO 5457's shorter corner fields are not implemented -- while the division counts are the standard's.

Inputs: size, marks, zones, layout, +3 more. Returns: object

std_feature_drawStandard Parts: Draw FeatureA

Add a standard feature to geometry that already exists - a foreign drawing being finished.

Local frame: (x, y) is on the axis, +X runs along the axis in the direction the feature extends and +Y is radially outward. The thread is the ISO 6410 representation (minor diameter at 0.8 x major, thread-length limit to the major) and its pitch comes from ISO 261 via size or from an explicit pitch - it is never guessed. Every other kind takes its dimensions from the registered standards table and is refused by name when that table is absent, when the size is outside its coverage, or when the row lacks a dimension the feature needs: no value is interpolated and no profile is reconstructed. DIN 332 form R is refused - only forms A and B are drawn.

Inputs: x (required), y (required), kind (required), params (required), +2 more. Returns: object

std_part_insertStandard Parts: InsertA

Define the part's block once, insert it, and write its std_part XDATA.

The block carries DESIG / STD / SIZE / MAT attributes and an ACADMCP_MECH payload, so a parts list is a read of the drawing rather than a naming convention. Refusals, all before any write: a designation outside the transcribed tables (named, with the nearest catalogue entries - nothing is drawn approximately), a malformed designation, a missing or stray nominal length, a view the family does not have, an attribute tag the block does not carry, and a non-finite coordinate or rotation.

Inputs: x (required), y (required), designation (required), view, +3 more. Returns: object

std_part_listStandard Parts: CatalogueA
Read-only

Catalogue rows with the dimensions a drawing needs, and their provenance.

Every row is transcribed from the named standard's own table and carries its source. Coverage is deliberately narrow: ISO 261 first-choice sizes only (M5-M36, M3-M24 for ISO 4762) and ISO 15 bore numbers 00-10 in the 600x / 620x / 630x series. A size outside a table is refused by name by std_part_insert with the nearest entries, never interpolated and never substituted. An unknown standard is refused with the list of catalogue standards.

coverage is the standards coverage manifest (also the resource autocad://standards/coverage): one record per registered table - the fastener and bearing tables above, ISO 261 and the feature tables std_feature_draw reads - with edition, table locator, implemented sizes, range and source. DIN 509, DIN 471/472, DIN 332-1 and ISO 3601-2 report "no rows transcribed"; transcriber and reviewer are null because the repository records none.

Inputs: query, standard. Returns: object

surface_textureSurface Texture Symbol (ISO 21920-1)A

Draw the 60° surface-texture vee with its annotation in the standard positions.

Refusals, all before the first entity reaches the drawing: a text height outside the seven ISO 1302 rows (2.5/3.5/5/7/10/14/20 mm — never interpolated), a lay that is not one of the seven ISO 1302 directions of lay, a machining outside any/required/prohibited, and a standard other than ISO 21920-1 or ISO 1302.

Inputs: x (required), y (required), ra, rz, +10 more. Returns: object

system_aboutBackend InfoB
Read-only

Get detailed information about AutoCAD MCP Pro capabilities and available tools.

Inputs: no named parameters. Returns: object

system_capabilitiesBackend CapabilitiesA
Read-only

Return machine-readable support modes for the active backend.

Inputs: no named parameters. Returns: object

system_get_variableGet System VariableB
Read-only

Get an AutoCAD system variable value.

Inputs: name (required). Returns: object

system_launchLaunch / Attach AutoCADA

Connect to the application named by CAD_PROGID (attach if running, launch otherwise) and report launched, attached, version and the active document. Refusals: headless, capability: "live_application" (there is no application to launch); an open_path that fails path validation. Pack: settings · lean: no.

Inputs: visible, open_path. Returns: object

system_preferences_getGet PreferencesA
Read-only

The whitelisted Preferences.* values, enum values as names (SaveAsType: "ac2018_dwg"), with read_only naming the four Files.* paths. Refusals: headless, capability: "preferences" (they live in the running application, not in a file); a key outside the whitelist. Pack: settings · lean: no.

Inputs: keys. Returns: object

system_preferences_setSet PreferenceA

Write one preference and report old, new and changed.

Refusals, all before any write: a read-only key (Files.*), an unknown key, a value of the wrong type, an int outside the authored range (AutoSaveInterval 0–600 min, CursorSize 1–100, PickBoxSize 0–50, …), an unknown SaveAsType name; headless, capability: "preferences". Pack: settings · lean: no.

Inputs: key (required), value (required). Returns: object

system_prompt_messageCommand-Line MessageB

Utility.Prompt: tell the operator something where they are looking. Nothing in the drawing changes. Refusals: an empty message; headless, capability: "interactive_prompt". Pack: settings · lean: no.

Inputs: text (required). Returns: object

system_run_commandRun AutoCAD CommandA

Execute an AutoCAD command string directly (COM backend only).

Append \n for Enter. Example: '_LINE 0,0 100,0 \n'.

IMPORTANT: commands that finish at an option menu (e.g. -LINETYPE, -LAYER, -STYLE return to '[?/Create/Load/Set]:' after their action) need an EXTRA blank line or 'X\n' to exit, otherwise AutoCAD stays at a prompt and the next COM call will deadlock. Example: '-LINETYPE _LOAD CENTER acad.lin\n\n'.

A verb denylist refuses obviously destructive commands, but it is a guardrail against issuing ERASE ALL by accident, NOT a security boundary — AutoCAD accepts hundreds of commands and any loaded ARX/LISP adds more. Prefer the typed tools (entity_delete, drawing_save_as, block_insert, drawing_purge): they validate their arguments, which a free-text command string cannot.

Inputs: command (required). Returns: object

system_run_lispExecute AutoLISPA

Execute an AutoLISP expression (COM backend only).

Example: '(setvar "DIMSCALE" 1.0)'

A symbol denylist refuses the known code-execution and file-I/O channels; text inside double quotes is treated as data, so drawing notes are not mistaken for code. It is a guardrail, NOT a security boundary — AutoLISP has more write channels than any denylist enumerates. Prefer the typed tools.

Inputs: expression (required). Returns: object

system_set_variableSet System VariableA

Set an AutoCAD system variable (e.g. DIMSCALE, LTSCALE, MEASUREMENT).

Refusals, before anything is written: a value outside the catalogued range or enum of a known variable, or a write to a read-only variable (DIMSTYLE, CANNOSCALEVALUE, DWGNAME, …), is refused with the catalogue's message — system_variable_describe(name) shows the range. A variable the catalogue does not know is passed through unchanged. The headless engine additionally refuses registry-saved variables (capability: registry_sysvar) because a file has nowhere to keep them, and names that ezdxf has no header slot for (a ValueError naming the variable).

Inputs: name (required), value (required). Returns: object

system_statusServer StatusA
Read-only

Get full status of the AutoCAD MCP Pro server and backend connection.

Returns backend name, connection status, capabilities, document info, and the document's document_id and content revision (headless: the active registry entry; live: the bound document, plus bound_document and active_document_changed). Live, the revision counts this server's own writes; edits the operator makes in AutoCAD are not counted.

operations lists the last 20 operation records, newest last: one per tool call (and per cad_batch step), with operation_id, tool, request_hash, state (committed / partial / failed / refused / quarantined / cancelled / unknown_commit / running), the document id and the revision before and after. Held in memory; a restart forgets them.

Inputs: no named parameters. Returns: object

system_variable_describeDescribe System VariableA
Read-only

What an AutoCAD system variable means, from an authored catalogue of 90.

With name: {known, name, type, range|enum, default, meaning, saved_in (drawing|registry|not_saved), engines: {ezdxf, com}, friendly_key, read_only} plus current when the active backend can read it (omitted, with current_unavailable, when it cannot — no document open, or a registry variable headlessly). An unknown name is never an error: known: false and the nearest catalogue names come back. With search: every row whose name or meaning contains all the words. With neither: the index of names. friendly_key names the drawing_settings key that wraps the variable, which is the preferred way to set it; engines.ezdxf: false means the headless engine refuses a write (registry-saved, or no header slot in ezdxf).

Inputs: name, search. Returns: object

template_apply_layersApply Layer TemplateA

Apply a standard layer set from a predefined template.

Available templates: architectural, mechanical, electrical, piping. Creates all layers defined in the template with standard colors and lineweights.

Inputs: template (required). Returns: object

template_listList Available TemplatesA
Read-only

List all available layer templates and their contents.

Inputs: no named parameters. Returns: object

text_find_replaceFind and Replace TextA

Replace text in TEXT, MTEXT and block attributes (ATTRIB and ATTDEF).

Both engines search the same places (searched_scope): model space, every paper layout, every named block definition - so the next insert does not reintroduce the old text - and the attributes of every block reference in any of them; an xref's block holds another file's text and is not searched. searched_types is on the response because "no matches" and "that type was never searched" are different answers. DIMENSION text is out of scope: its text field holds the <> override placeholder rather than the measurement, so editing it would break the association. Anonymous blocks (*D - a dimension's rendered measurement - *T, *U, *X) are renderings regenerated from their owner and are not searched either. A multi-line attribute is matched and rewritten as the whole value (Line1\PLine2), the same value block_get_attributes reports and block_explode bursts.

dry_run=True adds preview: the document's content revision, the exact fingerprint of every matched entity and the planned rows. Applied with that revision (expected_revision) and/or its preconditions, the search runs again first: an edited entity, a moved revision or a new match the preview did not list refuses the call with kind stale_revision and nothing is replaced. A guarded apply reports revision ({checked, after, interleaved}).

Inputs: find (required), replace (required), layer, dry_run, +3 more. Returns: object

text_set_backgroundSet Text BackgroundA

Mask what is behind an MTEXT so it stays readable over hatch or geometry.

MTEXT only: TEXT has no background-fill attribute, so setting one on it would report success and change nothing.

Inputs: handle (required), color, scale, enabled. Returns: object

textstyle_createStyles: Create Text StyleA

Create a text style.

Headlessly a font nobody can find is written and reported font_resolved: false (AutoCAD substitutes at open; the headless renderer falls back), because a DXF stores only the name. The live engine cannot do that: ActiveX refuses a font AutoCAD cannot open, so a file that is neither on its support path nor in the Windows Fonts folder is refused there before any write (the message names the folders and the presets); a TrueType font is written by its typeface (SetFont, what the STYLE dialog does — the record carries arial.ttf, never a machine path), an SHX by the file name. Refuses, before any write on both engines: a name that exists, an empty font, width_factor <= 0, height < 0, an oblique angle outside ±85°.

Inputs: font (required), name (required), height, oblique_deg, +2 more. Returns: object

textstyle_listStyles: List Text StylesC
Read-only

Every STYLE table entry and the one new TEXT/MTEXT will use.

Inputs: no named parameters. Returns: object

textstyle_set_currentStyles: Set Current Text StyleA

Set $TEXTSTYLE; entity_create_text / entity_create_mtext then carry the style on both engines. Refuses a style the drawing does not hold. Returns previous and changed.

Inputs: name (required). Returns: object

titleblock_applySheet: ISO 7200 Title BlockA

ISO 7200 title block, 180 mm wide, in the lower-right corner of any A4-A0 sheet. The title text is used verbatim.

Carries the ISO 128-30 projection-angle symbol: 'first' draws the cone on the left and the concentric circles on the right, 'third' is its mirror. Refusals, all before the first entity: an unknown size (the five covered sizes are listed), an unknown orientation, a projection that is not 'first'/'third'/'', a layout that does not exist. titleblock_apply_iso_a3 is this tool with size='A3' and no symbol, kept so no caller breaks.

Inputs: title (required), drawing_no (required), date, size, +17 more. Returns: object

titleblock_apply_iso_a3TitleBlock: ISO A3A

ISO 7200 / A3 (420x297 mm) title block. Title text is used verbatim.

Pass layout to put the sheet on a paper-space layout, which is where a title block belongs — the border frames the printed sheet, not the model. Your current space is restored afterwards, so asking for a border does not move you onto the sheet.

Inputs: title (required), drawing_no (required), date, scale, +11 more. Returns: object

transaction_beginBegin TransactionA

Begin a transaction (undo mark).

COM backend: Sets AutoCAD undo mark. All subsequent operations can be rolled back to this point with transaction_rollback.

ezdxf backend: Saves a DXF snapshot. Rollback restores the full document state to this point.

Always pair with transaction_commit or transaction_rollback.

Inputs: no named parameters. Returns: object

transaction_commitCommit TransactionA

Commit the current transaction.

COM: Ends the undo mark (changes are permanent but still undoable via drawing_undo). ezdxf: Discards the rollback snapshot (changes are kept).

Inputs: no named parameters. Returns: object

transaction_rollbackRollback TransactionA
Destructive

Rollback the current transaction to the point of transaction_begin.

COM: Undoes all operations back to the UNDO Mark transaction_begin set; refused (ok: false) when no transaction is active. ezdxf: Restores the document from the saved DXF snapshot.

WARNING: This is destructive – all changes since transaction_begin are lost.

Inputs: no named parameters. Returns: object

ucs_listList UCSB
Read-only

The world row first, then every UCS table entry with origin and unit axes, current on the active one. world is current only when the frame IS the WCS (WORLDUCS live, the $UCS* header headless) — an unnamed UCS (UCS Origin / 3P without saving) has an empty name too and is reported as a trailing row with name: null and its origin/axes, so current is null then and never world. Tool coordinates stay WCS on both engines whatever is current. No refusals. Pack: settings · lean: no.

Inputs: no named parameters. Returns: object

ucs_restoreRestore UCSB

Live: ActiveUCS for a named entry; world runs UCS World, which is refused while AutoCAD has an active command (CMDACTIVE — press ESC). Headless: the $UCSNAME/$UCSORG/$UCSXDIR/$UCSYDIR header variables. Refusal: an unknown name (lists the saved ones). Tool coordinates stay WCS. Pack: settings · lean: no.

Inputs: name (required). Returns: object

ucs_setSet UCSA

Store a UCS table entry and make it current (AutoCAD's UCS command).

Axes are normalised to unit vectors. Every tool keeps taking and returning WCS coordinates — the repository rule; a UCS is for the operator's own drafting, and no tool starts interpreting inputs in it. Refusals, before any write: a name of world (reserved), a zero-length axis, and non-perpendicular axes — the message carries the measured angle (tolerance 0.001°). Pack: settings · lean: no.

Inputs: name (required), origin (required), x_axis (required), y_axis (required). Returns: object

user_pick_pointAsk Operator: Pick PointA
Read-only

Utility.GetPoint: returns the WCS x, y (z) the operator clicks.

ESC is an answer, not an error: cancelled: true with AutoCAD's reason. Waiting longer than COM_CALL_TIMEOUT returns timed_out: true (the prompt is abandoned on AutoCAD's side; press ESC there). Refusals: an empty prompt; headless, capability: "interactive_prompt" (no operator). Pack: settings · lean: no.

Inputs: prompt (required). Returns: object

user_selectAsk Operator: SelectA
Read-only

Returns handles the operator picked — one with mode="single" (plus the picked point [x, y] in WCS — AutoCAD reports it in the current UCS and the tool translates, so a UCS made current by ucs_set never shifts it), any number with mode="multiple" (Enter with nothing selected is count: 0, not a cancel). ESC → cancelled: true; a wait longer than COM_CALL_TIMEOUT → timed_out: true. Refusals: a mode outside the two, an empty prompt; headless, capability: "interactive_prompt". Pack: settings · lean: no.

Inputs: prompt (required), mode. Returns: object

validation_checkValidate DrawingA
Read-only

Run quality checks on the current drawing.

Available checks:

  • empty_layers: Find layers with no entities

  • zero_length: Find zero-length lines

  • duplicate_entities: Find entities at the same position

Inputs: checks. Returns: object

view_named_listList Named ViewsB
Read-only

Every VIEW table entry with centre, height and width. No refusals. Pack: settings · lean: no.

Inputs: no named parameters. Returns: object

view_named_restoreRestore Named ViewA

Live: zooms the active viewport to the saved window the way -VIEW _R does — VIEWCTR becomes the saved centre and VIEWSIZE the saved height (or width / display aspect when the window is wider than the display); applied: "zoom_window" plus the read-back viewctr / viewsize. Headless there is no display: the saved window is fitted into the *Active VPORT — the view AutoCAD opens the file on — whose aspect ratio is left as the file carries it (AutoCAD reconciles a changed aspect by the viewport's lower-left corner, which shifts the centre); the result says applied: "header_only" with the written vport_height and the kept aspect_ratio, the same reported-no-op rule as view_zoom_extents. Refusal: an unknown name (lists the saved views). Pack: settings · lean: no.

Inputs: name (required). Returns: object

view_named_saveSave Named ViewA

Store a VIEW table entry (AutoCAD's VIEW command). Same name replaces (replaced: true). Refusals: height/width ≤ 0 or non-finite, a malformed center, and headless an empty drawing with no center/height (there are no extents to default to). Pack: settings · lean: no.

Inputs: name (required), width, center, height. Returns: object

viewport_createCreate ViewportA

Place a scaled model-space viewport on a paper-space layout.

The viewport window shows the model region centered at (view_center_x, view_center_y); view height = height / scale.

Inputs: width (required), height (required), layout (required), center_x (required), +4 more. Returns: object

viewport_deleteDelete ViewportA
Destructive

Delete a viewport.

The layout's main viewport needs force=true; deleting it removes the tab's own view state, and the layout's current-viewport pointer is repaired so the file does not carry a dangling reference that only CAD would notice.

Inputs: handle (required), force. Returns: object

viewport_listList ViewportsA
Read-only

List paper-space viewports: handle, geometry, scale and lock state.

The layout's own main viewport is included with is_main: true — it is the tab's pan/zoom state rather than a drafting viewport, and it is what remains after every drafting viewport is deleted. scale and locked are null on documents that cannot store them (R12) rather than fabricated.

Inputs: layout. Returns: object

viewport_lockLock ViewportA

Lock or unlock a viewport's display scale.

Inputs: handle (required), locked. Returns: object

viewport_set_scaleSet Viewport ScaleA

Rescale a viewport by adjusting its view height.

Geometric scale only: annotative text and dimensions do not resize with it. Refuses the layout's main viewport, whose view height is the tab's own pan/zoom state rather than a drafting scale.

Inputs: scale (required), handle (required). Returns: object

view_screenshotScreenshotA
Read-only

Capture a screenshot of the current drawing view.

COM backend: captures live AutoCAD window at current view. ezdxf backend: renders via matplotlib to PNG.

With overlay_handles, each entity is labelled with its handle at its own centre — every modify tool takes a handle, and without the labels there is nothing connecting "the circle at the top-left" to a hex string you can act on. Crowded drawings are capped and the image says how many of how many were labelled. Live AutoCAD captures its own window, so there is no render to label there; it refuses with capability: "handle_overlay".

Returns an Image content block with the PNG data.

Inputs: overlay_handles.

view_zoom_and_screenshotZoom and ScreenshotA
Read-only

Zoom to extents (or window if coordinates given), then capture a screenshot.

The most useful tool for visually inspecting drawing state.

Inputs: x1, x2, y1, y2.

view_zoom_extentsZoom ExtentsA

Zoom to show all entities in the drawing (fit drawing in viewport).

Inputs: no named parameters. Returns: object

view_zoom_windowZoom WindowA

Zoom to display the specified rectangular window region.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required). Returns: object

weld_symbolWeld Symbol (ISO 2553)A

Draw an ISO 2553 weld annotation: reference line, identification line, symbol, dimensions.

Refusals, all before the first entity reaches the drawing: a kind outside the six elementary symbols transcribed here (square, v, bevel, u, j, fillet — the rest of the ISO 2553 table is deliberately not shipped rather than guessed), a side outside arrow/other/both, a non-positive height, and a pitch given without a length.

Inputs: x (required), y (required), kind, side, +10 more. Returns: object

xref_attachSheet: Attach XrefA

Attach an external reference and insert it once. Both engines.

The block takes the referenced file's stem as its name. Refusals, all before anything is written: a kind that is not 'attach' or 'overlay', a file that does not exist, a non-positive or non-finite scale, and a block name the drawing already holds — detach it first with xref_manage(action='detach').

Inputs: path (required), x, y, kind, +2 more. Returns: object

xref_manageSheet: Manage XrefsA
Destructive

One operation on one external reference.

list, detach and path work on both engines. reload and bind need a live AutoCAD seat's xref manager: headlessly they are refused with capability: "xref_live" rather than pretended, and the refusal says which engine does them. Other refusals: an action outside the five, an unknown xref name, a 'path' action with no new_path. On the live engine a listed row's inserts and kind are both null — ActiveX's block interface carries neither a per-xref insert count nor an overlay indicator, and this server does not invent them. Headlessly both are measured: inserts counts every insert in the drawing, model space and paper space alike, and detach removes exactly those.

Inputs: action (required), name, new_path. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 243 tools

    Disambiguation2/5

    The tool set spans many domains (entity, layer, dimension, arch, mech, P&ID, drawing lifecycle, delivery) with broadly distinct purposes, but several families overlap heavily: entity_list, analysis_select_by_layer, analysis_select_by_type, analysis_find_in_region, selection_window, selection_polygon, selection_filter and entity_select_smart all return entity lists; drawing_info, system_status, analysis_entity_stats and analysis_layer_stats all report drawing state; drawing_save, drawing_save_as, drawing_export_dxf, drawing_export_dwg and drawing_deliver all write files. Descriptions often state which tool to prefer, but at 243 tools the risk of misselection is high.

    Naming Consistency3/5

    There is a readable domain-prefix scheme (entity_, layer_, block_, drawing_, pid_, arch_, mech_, std_, layout_, viewset_) applied fairly consistently, but conventions are mixed: mostly verb_noun (entity_create_line, layer_create) alongside noun_verb (arch_grid, arch_plan_from_spec, drawing_understand, drawing_scale_check) and oddities like entity_delete_many or arch_wall. Readable but not a single predictable pattern.

    Tool Count1/5

    243 tools is far beyond any reasonable surface for a single MCP server, dwarfing the 3-15 well-scoped range and even the 50+ extreme mismatch threshold. Even allowing for a large CAD domain, the surface is overgrown and many tools (batch/variants/wrappers) could be folded into fewer generic ones.

    Completeness4/5

    Coverage is unusually thorough: full drawing lifecycle, entity CRUD and modify operations, layers, blocks, dimensions, annotation (GD&T, welds, surface texture, title blocks, BOM), mechanical parts, P&ID graph/lines, architectural plans, plotting/delivery and requirement verification are all present. Minor gaps exist (no 3D solid modelling, limited trim/fillet/extend beyond LINE+LINE) but nothing that blocks core workflows.

    Maintenance

    ActivityMaintained
    ResponsivenessUsually handled

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to create, modify, inspect, and validate AutoCAD drawings through a single typed contract, driving live AutoCAD over COM on Windows or running headlessly with ezdxf anywhere. It covers ISO-compliant drafting, mechanical and architectural geometry, P&ID schematics, dimensions, tolerances and takeoffs, with tool packs and a discovery mode to control context cost.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to author, read, critique, and validate production CAD drawings through 247 typed tools spanning mechanical parts, architectural plans, P&IDs, takeoffs, and ISO GD&T / dimension-tolerance checks. It drives live AutoCAD over COM on Windows or runs headlessly anywhere via ezdxf, with pack and discovery modes to keep the advertised tool surface cheap.
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to drive AutoCAD through 247 tools using either live COM control on Windows or a headless ezdxf engine anywhere, with a shared typed contract. It covers mechanical part and assembly sheets, architectural floor plans with measured room areas, P&ID drafting and reading, ISO-standard dimensioning, GD&T and tolerance checks, plus drawing critique, diffing and material takeoffs.
      -