set_dimension
Changes a named sketch or feature dimension by value and rebuilds the SOLIDWORKS model, restoring the old value if the rebuild fails.
Instructions
Change a dimension by name and rebuild the model. Works on sketch dimensions and feature dimensions (depths, pattern spacing, fillet radius, ...). If the new value breaks a feature on rebuild, the old value is restored and the call fails. A size the tools dimensioned from the drawing (DrawnN) becomes the user's when set: it is renamed (the result says to what). A dimension an equation drives is refused, naming the equation (change it with set_equation). With more than one configuration, configurations is required: without it the call is refused, listing them.
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": {
"name": "<name>",
"value": "<value>"
},
"name": "set_dimension"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Dimension name from list_dimensions, e.g. 'D1@Sketch1' | |
| unit | No | mm, cm, m, inch or ft | |
| value | Yes | New value (length in unit, degrees for an angle, or a whole number for a pattern count) | |
| configurations | No | Configuration names to change, or ["all"]. Needed when the model has more than one configuration; with one, leave it out. |