Sum Simple Equations
Jun 16th, 2008 | By Alex R. Ruiz | Category: PartsThis is for all those who proclaimed in high school algebra, “I will never use this…” We use equations every day, even if you don’t know it. My paycheck is ‘X‘ and my bills are ‘Y‘ , money for fun stuff is X-Y= -Z …D’oh!. SolidWorks has the ability to use equations that can be anywhere from very simple equations and variables, all the way up to very complex equations. Admittedly, I can not do the more complex equations, even though SolidWorks can handle it, but I do use equations almost everyday. Today I will show you some simple equations tricks that you may end up using daily as well.
Adding Equations
There are a number of way you access the Equations window where you can add, edit and delete equations but the easiest is from the Tools menu. To access the Equations window click Tools -> Equations..
In the Equations window you can add, edit and delete equations. You can even apply equations to specific configurations…but that’s a different post.
Creating a ‘Variable’
As you may remember from high school algebra a variable is:
a symbol (like x or y) that is used in mathematical or logical expressions to represent a variable quantity
In SolidWorks you can create variables to decrease the time to make updates when a value is used in multiple places in your model. I create variables when I am designing a new product and I am still not set on some dimensions that I know will be changing and are used throughout the part.
Here is a simple example , we have a base plate that have four holes that will hold four shafts who’s diameter has not been set. At this stage in the design we are assuming that the shafts will be 0.75″ but we totally expect that it will change. We can link the dimension to a global variable that we can later update easily or reference with other dimensions. In the Equations window click Add…
In the Add Equation window you are presented with a scientific calculator that allows you to enter algebraic and trigonometric functions as well as simple statements. In the text field we will create our variable. Enclose the variable name in quotation marks and follow it with an equal sign then the value.
Once created you can see the variable listed in the Equations window along with the value. Here you can also suppress the equation by unchecking Active.
Using Variables
Variables you create in this manner can be used as follows:
- In other variables
- In other equations
- In dimensions
- Referenced by the parent assembly
- Custom Properties
For this example we will use the Shaft Dia variable we created to be used by a second variable, Shaft Hole. This new variable will drive the actually holes in the plate. The holes will be the proposed diameter of the shaft with a .010″ clearance. Doing it this way allows us to adjust the clearance for all holes quickly and updates the hole diameters as the shafts change. In the Add Equations window, we name the variable as we did with the first variable. For the subsequent formula we reference the previous variable in quotes and add the clearance value.
There is no use in creating variables if we are not going to use them. Now we need to attach the Shaft Hole variable to the actual hole dimension in the sketch. In the Modify dimension window, click the down arrow and select Link Value. We covered linking values in a previous post, Linking Dimensions in Sketches.
In the Shared Values, we can reference the variable we created. Click the down arrow in the Name field and select the Shaft Hole variable.
Click OK. The dimension is now linked to the variable. The dimension in sketch is now preceded with the link value and equation symbols. As the value of the Shaft Dia or clearance is changed, the dimension will be updated.
Using Linked Values in Simple Equations
Another equation I use often is a simple equation that uses linked values. Going back to the Base Plate from the previous example, we want the height of the plate to be directly proportional to the width. As the width of the plate is changed the height is updated based on the formula. First, create a linked value for the width of the plate.
In the Shared Values window apply the name Base Plate Width.
Then add the dimension to the height of the plate and select Add Equation in the Modify window.
Using the Add Equation function automatically begins a new equation with the name of the dimension. All you have to do is add the equation itself. Since we are making this dimension based off of the previously linked value, we type in the name of the linked value in quotes; “Base Plate Width” and finish the equation. We want the the height of the plate to be the width of the plate divided by 1.66667.
After clicking OK the evaluated value of the formula is listed in the Equations window.
In the sketch you will see the dimension preceded with either the linked value icon or the equation icon.
Viewing Named Equations
In the Equations folder in the FeatureManager you can view all the named equations.
Here you can change your equations or update the variables you created by right-clicking the equation and selecting Edit Equation.
If we need to change the shaft diameter as the design progresses, we update the variable and click OK.
Click OK in the Equations window and the variable along with all the referencing equations and dimensions will be updated.
That’s it. Your high school algebra teacher would be proud, you finally put what you learned to practical use. This is only a small part of what you can do with equations, sometime at a later date I will cover some tips and tricks when using equations.
If you enjoyed this post, make sure you subscribe to my RSS feed!
Related Links:Related posts brought to you by Yet Another Related Posts Plugin.





















Subscribe for Free! (RSS)
