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. (Fun fact link
if youโre curious about why.)
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. If youโre checking
out equations for the first time, a good place to start is the equations
tutorial you can access by going to Help > SolidWorks Tutorials. For
those of you that have been using equations for a while, leave a comment and
let us know what you think of the new enhancements. ย Be sure to
check out our YouTube channel
for more quick tips like this!