Sketch a rectangle
onshape_sketch_rectangleCreate a closed rectangle sketch on a default plane or feature face using opposite corners in inches, ready to extrude.
Instructions
Add a sketch holding one closed rectangle, ready to extrude. Corners are opposite, in inches.
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": {
"doc": "<doc>",
"ws": "<ws>",
"elem": "<elem>",
"corner1": "<corner1>",
"corner2": "<corner2>"
},
"name": "onshape_sketch_rectangle"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ws | Yes | Workspace id — the <ws> segment of the document URL. | |
| doc | Yes | Document id — the <doc> in cad.onshape.com/documents/<doc>/w/<ws>/e/<elem>. | |
| elem | Yes | Element id (tab) — the <elem> segment of the document URL. | |
| name | No | Feature name shown in the tree (default "Sketch"). | |
| plane | No | Default plane to sketch on (default Front). | |
| corner1 | Yes | First corner. As [x, y] inches or "x,y". | |
| corner2 | Yes | Opposite corner. As [x, y] inches or "x,y". | |
| validate | No | Re-read the feature list afterwards and fail if the feature regenerated with an error (default true). | |
| plane_feature | No | Sketch on a face created by this feature id instead of a default plane. |