export
Export 3D shapes to STEP/STL and 2D sketches to DXF/SVG, preserving assembly structure with named labels for downstream CAD tools.
Instructions
Export model. format: step, stl, dxf, svg, or comma-separated list e.g. 'step,stl' or 'dxf,svg'. 3D shapes (solids) export to step/stl; 2D shapes (Sketches and dimensioned drawings composed via build123d.drafting) export to dxf/svg. Mixing 2D and 3D formats for the same shape errors with a clear message. object_name: named object from show(), '' to export all named shapes as a combined assembly (default: current shape). STEP exports carry the session names as labels — single-object exports use the object_name, '' exports produce a Compound labelled 'assembly' with each child labelled by its show() name. Downstream CAD tools (FreeCAD, Fusion) will see the structured assembly with named bodies. Use dxf for engineering-drawing handoff to other CAD tools; svg for embedding in docs/wikis. The result echoes the exported shape's volume/bbox/face count (or bbox/edge count for 2D) as a final sanity check that the right, non-degenerate object was written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| format | No | step | |
| object_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |