← Overview / Cheatsheet

SCPC QUICK REFERENCE

Cheatsheet

The small public Script interface and native CLI commands at a glance. For context and limitations, read the complete API Guide.

About native parameters. Command IDs and parameter schemas belong to your installed SolidCraft engine; query them using --commands and --describe. These examples are not a complete catalogue of SolidCraft commands.

Build a command script

Script() + add()

Append native command IDs, in order.

script = Script()
script.add("sketch.create", plane="XY", name="Base")
Read explanation →

script.commands

Get a detached copy of the command list.

entries = script.commands
Read explanation →

to_dict() / to_json()

Export native data without running CAD.

document = script.to_dict()
text = script.to_json()
Read explanation →

Reopen existing commands

Script.load(path)

Import JSON as data, without executing Python.

plan = Script.load("output/commands.json")
Read explanation →

from_json() / from_dict()

Import a native JSON string or dictionary.

plan = Script.from_json(text)
plan = Script.from_dict(document)
Read explanation →

load_script(path)

Load ONE non-empty Script from trusted Python.

plan = load_script("model.py")
Read explanation →

Run and inspect

--out

Export native command JSON without CAD.

python -m scpc model.py --out output/plate.json
Read explanation →

--run --save

Run in native CLI and save editable SolidCraft .sc.

python -m scpc model.py --run --save output/plate.sc
Read explanation →

JSON replay

Run previously exported commands, not Python source.

python -m scpc output/plate.json --run
Read explanation →

--connect

Apply one authenticated batch to an open GUI.

python -m scpc model.py --connect
Read explanation →

--describe

Read one command schema from the running GUI.

python -m scpc --describe solid.extrude
Read explanation →