draw_rectangle
Adds a rectangle to the active SOLIDWORKS sketch using two opposite corner coordinates, with optional units; horizontal and vertical relations are applied for a defined sketch.
Instructions
Add a rectangle in the open sketch between opposite corners (x1, y1) and (x2, y2). Horizontal and vertical relations are normally added to its sides; list_sketch_entities shows them. In a part its width and height become dimensions when the sketch is closed, unless set first.
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": {
"x1": "<x1>",
"y1": "<y1>",
"x2": "<x2>",
"y2": "<y2>"
},
"name": "draw_rectangle"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x1 | Yes | X of the first corner | |
| x2 | Yes | X of the opposite corner | |
| y1 | Yes | Y of the first corner | |
| y2 | Yes | Y of the opposite corner | |
| unit | No | mm, cm, m, inch or ft |