cad_run_commands
Runs AutoCAD command-line input in the current drawing, exactly as typed in the app. Statements are separated by ";" or newlines; inside a statement tokens are separated by spaces and the statement ends with Enter. Example: "LINE 0,0 100,0 100,50; CIRCLE 50,25 10; CHPROP ALL; C red; LAYMRG N DOORS; N WALLS Y; DRAWORDER ALL; F". Every statement ends with Enter, so keep the follow-up answers of one command step in the same statement ("CHPROP ALL; LA WALLS C red"; a question asked after Enter goes in the next statement: "LAYDEL N TEMP; Y"). Objects are selected with ALL or P (previous). Returns the command log and any problems. 3D: points x,y,z; 3DPOLY, ELEV, VIEW (Top, Front, SWiso ...), UCS. 3D solids: BOX, CYL, SPHERE, EXTRUDE, REVOLVE, UNION, SUBTRACT, INTERSECT, MASSPROP. Use cad_list_commands to see every command.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| select | No | Optional Quick Select filter applied before the script; the commands then act on it (pre-selection, or P for previous). Example: { "type": "CIRCLE", "property": "radius", "op": "<", "value": 5 }. Properties: color, layer, linetype, lineweight, length, radius, area, text, height, blockname, measurement. Operators: =, <>, >, <, * (any). Text values accept * and ? wildcards. exclude: true inverts the filter. | |
| commands | Yes | Command script |