Global variables and equations are a great way to capture design intent and add intelligence to SOLIDWORKS models. If you’re new to global variables and equations in SOLIDWORKS, here’s a quick intro. And if you’re already a pro, check out the NEW items. Both the 2013 and 2014 versions of SOLIDWORKS introduced new functionality for equations.
Let’s use a simple example. In this computer monitor model, my first sketch is a rectangle to define the screen and has dimensions for the width and height. However, screens are typically sized by their diagonal length and aspect ratio, not width and height.
To take care of this, the width and height of my rectangle are controlled by global variables and equations. With two variables for “Diagonal Size” and “Aspect Ratio”, and some help from our buddy Pythagoras, I can create a couple of equations to define a 16:9, 20” screen.
Global variables and equations can be created and modified in a few different ways. You can go to Tools > Equations, launch the “Equations, Global Variables, and Dimensions” dialog box, and fill in the table.
You can also create global variables and equations directly in the “Modify” box of a dimension. Simply type in a name to define a new global variable, or type the = sign to begin a new equation.
NEW: One additional place where you can create global variables and equations, which was added in 2013, is directly in PropertyManager fields. Like the “Modify” box, just type in a name or the = sign.
NEW: Also added in 2013, global variables can have units! When working with global variables, units are commonly overlooked. This is the one place in SOLIDWORKS where the document units are not automatically added to the values you input. You have to explicitly type in the units. This gives us flexibility, but can be dangerous. For example, when I change the document units from inches to millimetres…
If I remembered to type “in” for inches, I get a 508mm (20”) screen to use as my second monitor:
But if I forgot to include my units, I get a somewhat less useful 20mm screen:
NEW: Now what if I want different sizes? With SOLIDWORKS 2014, global variables and equations are now configurable! Similar to dimensions, once you have created multiple configurations, a drop-down menu allows you to select which configurations to change.
So there’s a quick look at global variables and equations and some of the new options we have available to us. Of course, equations can be used to do a whole lot more in SOLIDWORKS, from controlling the number of pattern instances to conditionally suppressing features with “if” statements.