eval_autolisp
Evaluate arbitrary AutoLISP code in AutoCAD 2027 and return serialized results, either in a live GUI session or headlessly on an existing DWG file.
Instructions
Evaluate arbitrary AutoLISP code in AutoCAD 2027 and return the serialized result.
Args: code: AutoLISP expression(s) to evaluate, e.g. '(getvar "ACADVER")' or '(mcp:make-line ...)'. prefer_live: Use the live AutoCAD 2027 GUI window if available; falls back to headless AcCoreConsole if False or if input_dwg is provided. timeout_ms: Execution timeout in milliseconds. input_dwg: Optional path to an existing .dwg file to process in headless AcCoreConsole mode. save_as_dwg: Optional path to save the resulting .dwg file when running in headless mode.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| input_dwg | No | ||
| timeout_ms | No | ||
| prefer_live | No | ||
| save_as_dwg | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |