Sketch a shape
add_sketch_shape
Draws a rectangle, circle or polyline on the sketch.
- Needs
- Nothing to pick: it works on the whole document.
- In the editor
- Sketch: Line (L), Rectangle (R) and Circle (C), placed by taps, or by typing a line's length and angle, a rectangle's width and height or a circle's diameter while drawing.
- Tools tab
- A form of its inputs, filled from what is picked; Run makes the change, one step to undo.
- Agent and MCP
- The chat's agent and MCP clients call
add_sketch_shape, each call one step to undo. Over MCP it also takesproject,editorandrequest_id.
What it does
A closed shape on the sketch, which lies on the ground plane: a rectangle by its lower-left corner (x, y) and its size (w, h); a circle by its centre (cx, cy) and its diameter; a polyline by its corners in order, closed back to the first. The reply gives the shape's id, which Extrude a profile and Revolve a profile take.
A closed shape drawn directly inside another becomes a hole through it when the outer one is extruded.
Inputs
As the agent and MCP clients send them. One left out takes the default its description gives.
| Input | Type | What it is |
|---|---|---|
| kindneeded | one of "rect", "circle", "polyline" | Shape. |
| x | number | Corner X, in mm. |
| y | number | Corner Y, in mm. |
| w | number | Width, in mm. |
| h | number | Height, in mm. |
| cx | number | Centre X, in mm. |
| cy | number | Centre Y, in mm. |
| diameter | number | Diameter, in mm. |
| points | a list of 3 or more [x, y] | Corners, in mm. |
Limits
- No arcs, fillets or splines, and no constraints: retyping a length moves that edge's end and nothing else follows.
- One sketch, on the ground plane: not on a body's face or another plane. Shapes stay in the sketch after a body is made from them.
Examples
Given: An empty document.
add_sketch_shape { "kind": "rect", "x": -40, "y": -10, "w": 80, "h": 20 }Then: A rectangle from (-40, -10) to (40, 10).
Given: A sketch holding a 40 × 20 mm rectangle centred on the origin (id plate) with a 6 mm circle in its middle (hole), and a 4 mm square (ring) 30 mm along X.
add_sketch_shape { "kind": "circle", "cx": -14, "cy": 0, "diameter": 6 }Then: A circle inside the plate's outline: a second hole through it once the plate is extruded.