Run AutoCAD Command
system_run_commandExecute AutoCAD commands directly by sending a command string via COM to automate tasks. Add newline for Enter; add extra blank line for option menus to avoid deadlocks.
Instructions
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"command": "<command>"
},
"name": "system_run_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | AutoCAD command string (e.g. '_ZOOM E', '_REGEN', '_EXPLODE') |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||