Styles: Create Dimension Style
dimstyle_createCreate a dimension style with preset values and overrides, validating names, ranges, and block references before writing. Optionally set it as current for subsequent dimensions.
Instructions
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | New dimension style name, e.g. ISO-25, ANSI, MECH-A3 | |
| preset | No | iso-25 (ISO 129-1, 2.5 mm, comma) | ansi (ASME Y14.2, 3 mm, point); omit for the ISO-25 base | |
| overrides | No | DIM* variables applied on top of the preset, e.g. {DIMTXT: 3.5, DIMDSEP: '.', DIMTAD: 0} | |
| set_current | No | Also make it the current dimension style |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||