Remove material from a CAD body using a sketch profile to create holes or recesses. Supports through-all cuts and automatically fails if the sketch does not intersect the material.
Instructions
Cut material out of a body with a sketch profile (PartDesign::Pocket).
Fails if no material is removed — a profile positioned over empty space
is the most common mistake, and would otherwise silently "succeed" while
doing nothing. Through-holes (through_all=True) always cut from the
midplane: a sketch sits ON its base plane, so a one-directional
ThroughAll either cuts into empty space or produces an invalid solid
depending on which side of the plane the material is on.
NOTE: a sketch-based pocket can only cut FROM the plane it sits on, so it
can never leave material (a "floor") beneath itself on that side. For a
container cavity, use instantiate_family("box_enclosure", ...) or build
the cavity as a separate cutter solid positioned at z=floor_thickness.
Args:
doc_name: The name of the document.
body_name: The name of the PartDesign::Body to cut.
sketch_name: The name of the fully-constrained profile sketch.
name: The name to give the new Pocket feature.
length: Cut depth in mm (ignored if through_all=True).
through_all: Cut all the way through, from the midplane.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| length | No | ||
| doc_name | Yes | ||
| body_name | Yes | ||
| sketch_name | Yes | ||
| through_all | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |