MEAM.Design - SolidWorks - Parametric Modeling / Using Equations


Adding a new equation

To define more advanced relationships between model dimensions (or even to add relationships between multiple parts through an assembly), you'll want to add equations to your parts.

Before you get started, you may want to figure out the names of the dimensions that you're going to use to drive the equation. This can be done by hovering over a shown dimension, or you can turn on dimension names by going to Tools>Options... then selecting Show dimension names from within the General section. Once you do this, the name of the dimension will show up in parentheses below the value.

This is done by double-clicking on a dimension (either in a sketch or in the model view), then click the small down arrow next to the value, and select Add Equation...

(Note - You can also just open up the Equation viewer from Tools>Equations..., and then click Add..., but you'll need to define everything from scratch)

This will open the equation editor dialog box, with the name and location of the selected dimension on the left side of the equal sign (below, we see that we're editing dimension D1 in Sketch1 - if you rename your sketches and features, this would be replaced with whatever name you use).

Now you can define whatever equation you'd like on the right of the equal sign. To include other dimensions, you should enclose them in double-quotes (like you see above). As an alternative, you can click on the dimensions in the model window, and they should appear within the equation. Once you're happy with your equation, click OK, and you'll be presented with the Equation viewer, as shown below.

Here you'll see the equation you just created, along with any other equations or linked values that you've created. If all went well, you should see a green check mark under Evaluates to, along with the result of your new equation. If you need to edit your equation, you can highlight it and click the Edit button. Otherwise, click OK, and you'll be returned to your model or assembly.

You must rebuild (stoplight button or Ctrl-B) to have SolidWorks update your model with the new information

If all went well, you should now see the effect of your equation in your model/assembly. As evidence of your hard work, SolidWorks will display a capital Sigma in front of any dimension value that is driven through an equation, as you can see below:

Note - equations are strictly unidirectional, which means that these dimensions are completely dependent upon whatever is on the right of the equation your defined.

Editing your equations

To go back and change something about a previously defined equation, you have (at least) two options:

1. Double-click on the dimension, and from the drop-down menu select Edit Equation...

2. Open the equation viewer by selecting Tools>Equations..., which will show you with all of your equations. You can select the pertinent expression and click the Edit... button.