build_rectangular_pocket
Cuts a rectangular pocket into a body on a selected plane, defining center, dimensions, depth, and optional through-all or reverse direction.
Instructions
Hacer un vaciado rectangular en una sola operación.
Junior workflow: "agrégame un vaciado de 30x20mm centrado en (50, 30) de la cara frontal, 5mm de profundidad". Composes: create_sketch(plane) -> create_rectangle(corners) -> extrude_cut
Args: plane: Sketch plane — "front"/"top"/"right" (English) or "Alzado"/"Planta"/"Vista lateral" (Spanish), or a custom "Plano1" returned by create_reference_plane. center_x_mm, center_y_mm: Center of the pocket in sketch coords. width_mm: Pocket extent in the sketch's X direction. Must be > 0. height_mm: Pocket extent in the sketch's Y direction. Must be > 0. depth_mm: Cut depth. Required positive when end_condition="blind"; ignored when end_condition="through_all". end_condition: "blind" (fixed depth) or "through_all" (through the entire body). Default "blind". reverse_direction: Flip the cut direction. The plane-anchored default cuts toward the SW-default side of the sketch plane; if the parent body sits on the OTHER side the pocket cuts into air and extrude_cut returns None — pass True to correct it (same escape hatch as extrude_cut's reverse_direction). target_bodies: Restrict the cut to these body names (from get_active_part_info "bodies"). None (default) lets SW cut every body the pocket intersects — pass a list to keep a through cut from punching unintended bodies in a multi-body part.
Returns the resulting Cut-Extruir Feature info.
Example — 30x20mm pocket 5mm deep, centered on origin of Front plane: build_rectangular_pocket("front", 0, 0, 30, 20, 5)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plane | Yes | ||
| depth_mm | No | ||
| width_mm | Yes | ||
| height_mm | Yes | ||
| center_x_mm | Yes | ||
| center_y_mm | Yes | ||
| end_condition | No | blind | |
| target_bodies | No | ||
| reverse_direction | No |