script
Assemble all successfully executed code blocks into a single Python script for exporting reproducible CAD models. Optionally save to a file.
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 |