Hide Table of Contents

Global Variables

You can create global variables to use in equations. You define global variables in the Equations dialog box. For example, Well_Volume = 20000.

You can:
  • Define global variables using other global variables and dimensions. For example, Height = "Well_Volume"/(pi*("D1@Sketch4"/2)^2)).
  • Drive dimensions using global variables. For example, D1@Extrude1 = "Height".
  • Share global variables among models.
  • Configure global variables.
Global variables and their current values appear:
  • In the Equations dialog box.
  • In the Equations folder FM_equations.gif in the FeatureManager design tree.
  • Under Value/Text Expression on the Custom tab in the Summary Information dialog box.
  • Under Value/Text Expression in the Weldment dialog box.

Using Global Variables Instead of Linked Values

Global variables can be used for many of the same purposes as linked values (also referred to as shared values or linked dimensions). Global variables are much easier to find, change, and manage than linked values.

To use a global variable to link dimensions:

  1. Create a global variable in the Equations dialog box or the Modify dialog box for dimensions.
  2. Set two or more dimensions equal to the global variable.
When you change the value of a global variable, both dimensions are changed to the new value.

Adding a Global Variable in the Equations Dialog Box

To add a global variable in the Equation View:

  1. Do one of the following:
    • Click Equations OTTool_Equations_Tools.gif (Tools toolbar).
    • Click Tools > Equations.
    • Right-click the Equations FM_equations.gif folder in the FeatureManager design tree, and select Manage Equations.
  2. Select the Equation View equations_view_icon.
  3. In the Global Variable section, click an empty cell in the Name column.
  4. Enter a name for the global variable.
    The SOLIDWORKS software does the following:
    • Encloses the name in quotation marks.
    • Moves the cursor to the Value/Equations column and inserts = (equal sign).
    • Displays a flyout menu with options for starting the global variable
  5. After = (equal sign), add a term or a dimension to the global variable by doing one of the following:
    • Click a dimension in the graphics area. SOLIDWORKS propagates the dimension name in the cell.
    • Type a number or a conditional statement.
    • Select Measure ... from the flyout menu and use the Measure Tool to create the term.
    A PM_OK.gif appears in the cell to indicate that the syntax is valid.
  6. Type + (plus), - (minus) or another mathematical symbol.
  7. Add another term to the global variable.
  8. When the global variable is complete, click PM_OK.gif.
    The solution to the global variable appears in the Evaluates to column and the cursor moves to the next cell in the Comments column.
  9. Add comments to document your design intent.
  10. Click OK to close the dialog box.

Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

Subject:   Feedback on Help Topics
Page:   Global Variables
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:


We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again

Web Help Content Version: SOLIDWORKS 2016 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.