set_equation
Add or replace a SolidWorks equation to persist parametric relations, then rebuild and remeasure. Use for global variables or linking dimensions without losing the relation.
Instructions
Add an equation, or replace the one that sets the same name; rebuild and remeasure.
A SolidWorks equation string, e.g. '"D1@BlockExtrude" = 25' or '"D1@BlockExtrude" = 2 * "D1@Sketch1"'. A global variable is '"W" = 40'; link a dimension to it with '"width@Sketch1" = "W"', and set '"W" = 45' again to change it. Persists a relation (unlike set_dimension). A list of equations is set in order with one rebuild at the end (later ones may use earlier ones), and a refused one undoes the whole list. Returns the index (per equation for a list), whether it replaced one, the features that fail to rebuild (failing_features) and mass properties.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| equation | Yes |