SolidWorks Quick Tip - Global Variables and Equations

SolidWorks Quick Tip – Global Variables and Equations

Table of Contents


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.

Global Variables and Equations in SolidWorks - Screen shot

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.)

Global Variables and Equations in SolidWorks - Sketch

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.

Global Variables and Equations in SolidWorks - Tools, Equation Dialog Box

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.

Global Variables and Equations in SolidWorks - Modify Box

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.

Global Variables and Equations in SolidWorks - Property Manager

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:

Global Variables and Equations in SolidWorks - The Importance of Units

But if I forgot to include my units, I get a somewhat less useful 20mm screen:

Global Variables and Equations in SolidWorks - The Importance of Units

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.

Global Variables and Equations in SolidWorks - Multiple Configuration Dropdown

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!

Picture of Terence Woo

Terence Woo

Terence Woo is a product manager at our Hawk Ridge Systems office in Vancouver, British Columbia. He has extensive experience with SOLIDWORKS and SIMULIA analysis tools and helped hundreds of customers solve problems across many industries. When he isnโ€™t working on simulation models, he spends his free time skiing, golfing, rock climbing and playing hockey.