set_variable
Set or update a single variable in an Onshape Variable Studio while preserving all other variables. The type is automatically determined from the expression's units, enabling precise control over CAD parameters.
Instructions
Set or update a variable in a Variable Studio, preserving the other variables. The type (LENGTH/ANGLE/ANY) is inferred from the expression's units
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Variable name | |
| elementId | Yes | Variable Studio element ID (create one with create_variable_studio) | |
| documentId | Yes | Document ID | |
| expression | Yes | Variable expression (e.g., '0.75 in') | |
| description | No | Optional variable description | |
| workspaceId | Yes | Workspace ID |