Page 353 - Mastering SolidWorks
P. 353
|
326 CHAPTER 10 USIng EqUATIOnS
Figure 10.10
An equation using IF
You can use an IF statement—or any other VBA (Visual Basic for Applications) function—to
control the suppression state of features and components. This function is described in detail
later in this chapter.
Using Global Variables
A global variable (supersedes pre-2012 link value) is just a name assigned to a dimension, a
reference measurement, or an entire equation. Linked values are still extremely powerful tools.
The fastest way to link multiple dimensions in bulk is by using a link value.
Global variables are assigned in the Equations dialog box or in the Modify dimension box as
simply the variable name equaling an expression or a value. Figure 10.11 shows a list of equa-
tions and global variables. When you type a variable name, you do not need to add the quotation
marks; they are added automatically. The global variable named “multiplier” uses an expression
to calculate its value. The global variable shown in Figure 10.11 called “global variable” is simply
assigned a value directly.
Figure 10.11
Equations and
global variables