← Overview / Plate example
NATIVE COMMAND SCRIPT
Plate with rounded edges and holes
A complete SCPC Plate fixture: parameters, sketch, extrusion, fillet and four native hole commands. Its JSON is produced from the actual Python source on every build, not copied by hand.
12 native commands · tested with SolidCraft 0.30.1 in CI
Python source
"""A complete native Plate, written as SCPC commands, NOT as a Forge model.
Compare models/basic/plate/scpf/model.py in the CAD project.
Everything below is already a SolidCraft command ID or parameter.
"""
from scpc import Script
script = Script()
for name, value in (("length", 100), ("width", 60), ("thickness", 10)):
script.add("parameters.add", name=name, expression=str(value), unit="mm")
script.add("sketch.create", plane="XY", name="Plate footprint")
script.add("sketch.rectangle.two_point",
p0=["-length / 2", "-width / 2"],
p1=["length / 2", "width / 2"])
script.add("sketch.finish")
script.add("solid.extrude", distance="thickness", body_name="Plate")
# These are the native SolidCraft edge positions, not a SCPC fillet helper.
script.add("solid.fillet", body="Plate", radius=2,
edges=[[-50, -30, 5], [50, -30, 5],
[50, 30, 5], [-50, 30, 5]])
for x, y in ((-35, -15), (35, -15), (35, 15), (-35, 15)):
script.add("solid.hole", position=[x, y, 10],
diameter=8, targets=["Plate"])
View model.py →
Native command sequence
parameters.addparameters.addparameters.addsketch.createsketch.rectangle.two_pointsketch.finishsolid.extrudesolid.filletsolid.holesolid.holesolid.holesolid.hole