SOLIDWORKS Quick Tip – Global Variables and Equations

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.

img_53079127573ae

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.

img_53079135bc723

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.

Hawk Ridge Systems
Hawk Ridge Systems is your official provider for SOLIDWORKS, CAMWorks, HP 3D Printers, Markforged 3D PrintersUnionTech 3D Printers, and Artec 3D Scanners in the United States and Canada. From concept to production, our team of experts will work with you to offer the best SOLIDWORKS training, SOLIDWORKS support, and experience available to meet your organization's needs.
Hawk Ridge Systems
Hawk Ridge Systems