Skip to content
English
  • There are no suggestions because the search field is empty.

Creating Global Variables in an Assembly that Drive Children Component Dimensions

Using global variables to edit more than one part in an assembly.

This article explains how to use equations and global variables in SolidWorks to automate dimension control across assembly components. When dimensions in an assembly are interdependent, equations allow a single global variable to drive multiple part dimensions simultaneously — eliminating the need to open and update each part file individually. Follow the four steps below to set this up.

Step 1: Rename your Dimensions

To rename a dimension, first enable Show Feature Annotations (right-click in the graphics area or via the View menu) to make feature-level dimensions visible in the assembly. Then, double-click the feature or sketch under the relevant part in the assembly tree to expand it. Double-click the dimension you want to rename, type a descriptive name in the text box above the dimension (see Figure 1), and click the green check mark to confirm.

Renaming dimensions

Figure 1: Modify Dimension Box

When clicking accept, it will rename the dimension thus making it easier to find. The two dimensions in this example will be the two circular surfaces renamed to “Dimension 1” and “Dimension 2 “.

Example Assembly

Figure 2: Example Assembly

Step 2: Declare a Global Variable

Declaring global variables before setting up equations keeps the Equation Manager organised and makes variables easy to reference. To add a global variable, open the Equation Manager via Tools > Equations, click the Global Variables section, and enter a name and value. In this example, the global variable is named “Diameter”.

Equation Manager with global variable

Figure 3: Equation Manager with global variable

In this example we want this “Diameter” global variable to drive “Dimension 1” and “Dimension 2” by making both equal to the global variable “Diameter”.

Note: we only make them equal in this case, you can apply any mathematical relationship that fits the design intent.

Step 3: Set Up the Equations

Add dimensions to the Equations – Drive Components section using one of two methods: (1) click the correct cell in the Name column and then click the dimension directly in the graphics area, or (2) type the dimension name manually using the format "DimensionName@SketchOrFeatureName@PartName". Set the Value/Equation column for each dimension to ="Diameter" (or your chosen global variable).

Equation Manager with Filled-in Equations.

Figure 4: Equation Manager with Filled-in Equations

Step 4: Rebuild and Save

Once the equations are in place, rebuild the assembly using Ctrl+B (or Edit > Rebuild), then save. SolidWorks will update the driven dimensions in each part file and set them to read-only, ensuring the assembly-level equations remain the single source of truth for those values.

If we rebuild to any value of “Diameter”, it will be noticed that the diameters change to become equal to each other accordingly:

Result of setting a global variable.

Figure 5: "Diameter” = 60mm Result

If the assembly becomes corrupt or that data is lost. it is possible to eliminate the read-only component by simply deleting the dimension and adding a new one in the part file.

 

Date published: 12/08/2022