Create sketch
create_sketchDraws 2D rectangles, circles, lines, arcs, polygons, and hexagons on an Onshape plane or planar face and returns a feature ID for extrusion.
Instructions
Create a sketch of 2D shapes on a plane or planar face. Point coordinates are [x, y]
in the sketch's own axes, in the configured length unit (mm by default). Returns the
sketch's feature_id, to pass to extrude. Tip: verify placement afterwards with
get_part_properties or a screenshot.
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": {
"document_id": "<document_id>",
"element_id": "<element_id>",
"shapes": "<shapes>"
},
"name": "create_sketch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Sketch | |
| plane | No | 'Top' (XY plane), 'Front' (XZ plane) or 'Right' (YZ plane) of the origin, or the ID of a planar face / plane from get_body_details to sketch on an existing face. | Top |
| shapes | Yes | 2D shapes to draw: rectangle, circle, hexagon, line, arc or polygon. Closed shapes become regions that `extrude` can turn into solids. Sizes (diameter, radius, width, height, across_flats) may be variables such as '#shank_diameter': the sketch then follows the variable. | |
| element_id | Yes | Element (tab) ID: the string after /e/ in the Onshape URL. Get it from get_document. | |
| document_id | Yes | Onshape document ID: the 24-character hex string after /documents/ in the document URL. Get it from list_documents. | |
| workspace_id | No | Workspace ID (the string after /w/ in the URL). Optional - defaults to the document's main workspace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||