execute_script
Run Python scripts inside FreeCAD’s main thread to automate modeling tasks, with optional transaction wrapping so changes can be undone.
Instructions
Execute Python inside FreeCAD's main thread (escape hatch; undoable when wrap_transaction=True).
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": {
"script": "<script>"
},
"name": "execute_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | ||
| doc_name | No | ||
| wrap_transaction | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||