Getting started
What SCPF does
SCPF is a Python interface and compiler for native SolidCraft commands. It is not a replacement CAD kernel. You describe a model using ordinary Python; SolidCraft executes the generated commands and owns the final geometry and feature history.
Install the library
In the lib.py.solidcraft.forge repository and an active Python environment:
python -m pip install -e ./scpf
python -m unittest discover -s scpf/tests -vYour first model
Define one class, give it numeric dimensions, and return the body from build(). No main() or show() is necessary.
from scpf import Box, Edges
class Plate:
length = 100.0
width = 60.0
thickness = 10.0
def build(self):
plate = Box(self.length, self.width, self.thickness)
return plate.fillet(2, edges=Edges.VERTICAL)
Plate()Compile, inspect, then execute
Save the model as model.py. Compilation alone does not open SolidCraft. The JSON is a native command plan, not a mesh or STEP file.
python -m scpf model.py --out output/model.json
python -m json.tool output/model.jsonFor a live GUI run, open SolidCraft, enable Preferences → Assistant → Let AI agents connect, and use:
python -m scpf model.py --connect --new--new asks SolidCraft to replace the active design with a new, empty one before the model batch is sent. Leave it off when you deliberately want to add commands to the current design. Neither form saves the design. The CAD project also provides a separate native CLI qualification workflow.
Where to continue
Read Model objects first. Then read Positioning and orientation. That chapter explains the practical difference between at(), on(), Shape.attach(), Placement and Occurrence.attach(). After that, From one component to an assembly shows how separate physical parts are combined.