execute_file
Runs a build123d script in a clean namespace and promotes the resulting shape for further CAD work; restores the previous model if the script errors, times out, or produces no shape.
Instructions
Execute a canonical build123d .py file in a clean namespace and atomically promote its result. The prior active model is restored if the source has a syntax/runtime error, times out, produces no shape, or does not produce result_name. Assign a Shape to result or call show(); optionally set result_name to require/register a specific Shape or BuildPart variable. snapshot saves the promoted geometry checkpoint. Returns source SHA-256 provenance plus captured output. The source must be UTF-8, under an allowed read root, and no larger than BUILD123D_MAX_SCRIPT_BYTES (default 2 MiB). Use this for substantial generation revisions: edit model.py, execute_file(), then validate/measure/render/export through MCP.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| snapshot | No | ||
| result_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |