Create a starter project
The bundled basic starter creates a design with two positioned plates and a typed width input. It is the quickest way to see the whole loop: declare, evaluate, inspect.
1. Create the project
Section titled “1. Create the project”machinewright project init indexing-table --starter basiccd indexing-tableuv syncproject init creates a new directory and refuses to overwrite an existing one. Use --output-dir to choose the parent directory. The generated project pins Machinewright to the Git release tag that matches the version you ran, with a v prefix.
From a Machinewright checkout, uv run machinewright project init indexing-table --output-dir .. creates a sibling project.
2. Look around
Section titled “2. Look around”indexing-table/├── design.py # parts, assembly and the machine template├── inputs.json # typed inputs for the template├── machinewright.toml # declares templates and input configurations├── pyproject.toml└── README.mdinputs.json holds the requirements the design reads:
{ "requirements": { "plate_width_mm": 40 } }design.py defines a Requirements contract, a Plate part, a Machine assembly, and a machine_template function that ties them together:
class Plate(PartDefinition): material = MATERIALS["PLA"]
def __init__(self, width_mm: float): self.width_mm = width_mm
def geometry(self) -> cadquery.Workplane: return cadquery.Workplane("XY").box(self.width_mm, 20, 4)
class Machine(AssemblyDefinition): def __init__(self, width_mm: float): self.width_mm = width_mm
def define(self, builder: AssemblyBuilder) -> None: builder.part("base", Plate(self.width_mm)) builder.part("cover", Plate(self.width_mm), transform=Transform.translated(z=12))3. Validate and evaluate
Section titled “3. Validate and evaluate”uv run machinewright project validateuv run machinewright project evaluate indexing-table.main 0.1.0 inputs.json artifacts/Evaluation writes an artifact bundle to artifacts/: STEP and STL geometry, a preview SVG, structured BOM (JSON and CSV), the canonical graph (JSON and Graphviz DOT), and a provenance manifest. Printed parts also produce a print-layout STL.
4. Change an input
Section titled “4. Change an input”Edit plate_width_mm from 40 to 60 and evaluate into a new folder:
uv run machinewright project evaluate indexing-table.main 0.1.0 inputs.json artifacts-wide/Both plates widen, because both read the same input. Compare the two manifests: the graph digest differs, and the artifact hashes record exactly what changed.
5. Open it in the app
Section titled “5. Open it in the app”Open the macOS app, choose Open Project, and select the indexing-table folder. Select design.py to edit it, and use the Inputs panel to change values and see the viewport update. Panel edits last for the session; edit inputs.json to make them permanent.