create_pocket
Generate or regenerate a 2D pocket toolpath from closed chains, with nested chains treated as islands, to machine flat pocket geometry in Mastercam.
Instructions
Create and regenerate a 2D pocket (closed chains; chains inside others are islands).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tool_number": "<tool_number>",
"depth": "<depth>"
},
"name": "create_pocket"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| chain | No | Geometry to machine: {"entity_ids": [..]} (ids from list_geometry), or {"level": n, "depth": z or "all", "closed_only": bool}: curves lying flat in the tool plane. Omit = all levels. If curves are at several depths, depth (plane Z) is required. Closed chains run clockwise seen from the plane, so comp_side left = outside, right = inside. | |
| depth | Yes | Pocket floor (absolute Z unless linking.depth_incremental) | |
| plane | No | Tool plane: top, front, back, bottom, left, right or a plane name (HMC: front = B0). Curves are chained in this plane | |
| finish | No | {"passes": n, "spacing": d}, or false to disable finishing | |
| coolant | No | flood, mist, thru or off | |
| linking | No | Heights: {"clearance", "retract", "feed_plane", "top_stock"} are absolute Z unless the matching "*_incremental": true (also "depth_incremental"); "clearance_on", "retract_on", "rapid_retract". For drilling, feed_plane is the R plane. | |
| subtype | No | standard, facing, island_facing, remachining, open | |
| stepover | No | Roughing stepover distance (default 50% of the tool diameter) | |
| feed_rate | No | ||
| depth_cuts | No | Multiple Z steps: {"max_rough_step", "finish_cuts", "finish_step"} | |
| parameters | No | Any other parameter by path, e.g. {"LeadInOut.Enabled": true}. See get_operation_parameters for names. | |
| leave_stock | No | ||
| plunge_rate | No | ||
| tool_number | Yes | ||
| retract_rate | No | ||
| length_offset | No | H number (default: the tool's) | |
| spindle_speed | No | ||
| diameter_offset | No | D number (default: the tool's) | |
| leave_stock_floor | No |