set_equation
Sets a global variable or dimension equation in a SOLIDWORKS model and rebuilds it, rolling back changes that break the model.
Instructions
Set an equation and rebuild. name is a global variable ('Wall'; created when new) or a dimension ('D1@Sketch1'); alternatively give index from list_equations. expression is the right-hand side, e.g. '3mm' or '"Wall" * 2'; a number without a unit is in the document's unit (20 is 20 inch in an inch document). A change that breaks the model is rolled back. A size the tools dimensioned from the drawing (DrawnN) becomes the user's when an equation drives it: it is renamed (the result says to what).
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": {
"expression": "<expression>"
},
"name": "set_equation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Global variable (e.g. 'Wall') or dimension (e.g. 'D1@Sketch1') | |
| index | No | Index of an existing equation (instead of name) | |
| expression | Yes | Right-hand side, e.g. '3mm', '"Wall" * 2' |