execute_code
Run Python code in FreeCAD's GUI thread to automate parametric modeling, with print output returned and mutating runs committed as one undoable step.
Instructions
Run Python in FreeCAD's GUI thread (FreeCAD/App, FreeCADGui, Part pre-imported); print() output is returned.
The run is transactional: a mutating snippet commits as one undoable step, a read-only run is not recorded.
Args:
code: Code to run; start with a # comment naming the step, which becomes the step's row label and description.
doc_name: Bind the transaction, step journal and App.ActiveDocument to this document; defaults to the session's document, else the process's home document.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| doc_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |