Build: run a uCAD script
run_scriptRun a whole uCAD script on a drawing in the user's account (a new drawing when drawing is left out) and keep the result there. Returns the report (every solid with its size and place, warnings, print() output, or the error with its line), the drawing's id and link, and pictures of it. Each run replaces what the drawing's previous run made. The language is at spec version e597bdd3ef: if what you know of it is another version (or none), call specs first.
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": {
"code": "<code>"
},
"name": "run_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The whole script (uCAD's Python, see specs) | |
| name | No | A name for a new drawing (as the user sees it in Open) | |
| views | No | The sides to show it from (one picture each): iso, iso_back, front, back, left, right, top, bottom. Default: iso. | |
| width | No | Picture width in pixels (default 800) | |
| height | No | Picture height in pixels (default 600) | |
| drawing | No | The id of the drawing to run it on. Left out: a new drawing. | |
| spec_version | No | The spec version (from specs) the script is written for. Now: e597bdd3ef |