Run Python Script
run_scriptExecute custom Python in FreeCAD's worker with App, Part, and ObjectsFem in scope. Set result to return JSON-serializable data; new shape objects auto-register for immediate use by other tools.
Instructions
Escape hatch: execute Python in the worker with App/Part/ObjectsFem in scope.
Set __result__ in the script to return a JSON-serializable value.
auto_register (default True): any new shape-bearing object the script
creates is automatically registered into the handle table. The result
includes a registered list of {handle, name, type} entries so the next
tool call (render_view, list_faces, fillet_edges, mass_properties, etc.)
can address script-created objects via handle without a separate
register_handle round-trip.
Disabled unless ANKUSDRIVE_ALLOW_RUN_SCRIPT permits it (the Claude Desktop extension defaults it off); when disabled this tool is not registered at all.
Returns {result, registered}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| auto_register | No |