← 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

  1. parameters.add
  2. parameters.add
  3. parameters.add
  4. sketch.create
  5. sketch.rectangle.two_point
  6. sketch.finish
  7. solid.extrude
  8. solid.fillet
  9. solid.hole
  10. solid.hole
  11. solid.hole
  12. solid.hole

View generated JSON →

Verification boundaries. The Python API and JSON format are tested independently of the actual CAD geometry. A separate CI job runs the native SolidCraft 0.30.1 engine, checks the resulting Plate and its feature history, and reports failures. Read the test methodology →