script
Combines all successfully executed code blocks into a single Python script, prepending the required import, and optionally saves to a file for reproducible CAD model generation.
Instructions
Return a single Python script assembled from all successfully executed code blocks in this session. Prepends 'from build123d import *' if not already present. If save_to is given, writes the script to that path and returns {script_path, blocks}; otherwise returns {script, blocks}. Useful for exporting a reproducible script after an interactive session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save_to | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |