New Drawing
drawing_newCreate a new AutoCAD drawing from a bundled or file-path template, and optionally add standard engineering layers and linetypes.
Instructions
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template | No | Bundled template name (drawing_template_list: iso_a3_mech, iso_a1_arch, iso_a3_pid, ansi_b_mech, ansi_d_arch) or a path to a .dwt/.dxf template file. | |
| bootstrap | No | Auto-load CENTER/HIDDEN/PHANTOM linetypes and create standard engineering layers (GEOMETRY, DIM, CENTER, HIDDEN, PHANTOM, HATCH, TEXT, TITLEBLOCK). Disable for vanilla DXF. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||