Level 5 · Pro workflow · about 12 minutes · free

Script designs with solidcraft-cli

Every click is a command, so a design can be a JSON script that the CLI runs, measures, renders and exports without a window.

Script designs with solidcraft-cli: the finished result in SolidCraft
Start the interactive lesson: narrated demo, steps and quiz →

What you’ll learn

Step by step

  1. Write a script:
    {"commands": [
     {"command": "sketch.create", "params": {"plane": "XY"}},
     {"command": "sketch.rectangle.two_point", "params": {"p0": [0,0], "p1": [40,30]}},
     {"command": "sketch.finish", "params": {}},
     {"command": "solid.extrude", "params": {"distance": 20}},
     {"command": "solid.fillet", "params": {"edges": [[0,0,10]], "radius": 3}}
    ]}
  2. Run: solidcraft-cli run box.json --out box.step
  3. Measure: solidcraft-cli eval box.json
  4. Picture: solidcraft-cli snapshot box.json --out box.png --view top
  5. Other sizes: if the script defines parameters, override them when you run it, for example --param width=30mm --param depth=width/2.

Tips

Check yourself

A parameter change breaks a feature. What does run do?

It exits with status 1, lists the failing features and writes no output files unless you pass --allow-errors.

← Work with supplier models: STEP files from other CADModel with AI agents →

SolidCraft is an open-source project by its own authors. Craftpath is an independent, free learning resource.