cad_variable
Set or list parametric variables in CAD documents, using numeric values or expressions that reference other variables for dynamic dimension control.
Instructions
Set or list parametric variables in the current document.
按 ``action`` 设置(set)或列出(list)当前文档的参数变量。Set with
``value`` and/or ``expr`` (expressions may reference other variables,
e.g. ``width * 2``); ``{name}`` tokens in CLI draw arguments interpolate
the resolved value.
When not to use: variables are document-scoped bookkeeping — do NOT use
them to store free-form strings (only numeric values), and use
``cad_object_update`` for geometry changes rather than variables.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variable | No | Variable action, discriminated by `action`: set (define/update with value, unit or expr) or list. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Variable name | |
| unit | No | Unit suffix | |
| count | No | Number of variables | |
| value | No | Evaluated value | |
| action | Yes | Variable action | |
| status | Yes | Operation status: success / error | |
| message | No | Status description | |
| variables | No | Variable records |