Perception Engineering

View Original

SolidWorks: Global Variables in Assemblies

Global variables are valuable time savers when it comes to using SolidWorks. They can save you loads of time when modeling. Not only can it save you time when modeling your parts, but you can also use this tool in your assemblies to make updates to multiple parts with the change of a single global variable. If you’ve never used global variables before, check out this blog that goes over the basics before continuing.

When using global variables in assemblies, create all the parts you desire to use and place them in the assembly. Be sure your parts have a dimension assigned, even if you plan on changing or assigning to a global variable. In this blog, I will be walking through the assembly of a simple box. For my assembly I will create four global variables; overall width, height, and depth of the box along with the thickness of the panels used.

In my assembly, the base of the box will fit inside all the sides so all the bottom faces will be flush. The side panels will fit inside the front and back panels. This means the front and back panels will have the overall length and height dimensions. To apply a global variable, double click on the face of the part and the dimensions used to model it should appear.

The dimensions in black are the sketch dimensions while the blue dimensions are the value entered for the extrusion feature. You can now double click these dimensions to make a change, prompting the Modify window to pop-up.

Now, just as you would with applying global variables to a part, you can apply them within an assembly. The following equations were used for my assembly. The length, height, and thickness are in reference to each part’s individual coordinate system, not their orientation in the assembly.

I modeled each of the parts as having the length as the x-direction, the height as the y-direction, and the thickness as the z-direction.

The subtraction of 2*“Panel Thickness” was used where a part was seated in between two other faces, such as the sides being seated within the front and back faces. The finished product can be seen following.

This technique does take some more planning and careful thought on the front end; however, it can easily pay off if multiple changes are desired. Now the box’s overall dimensions or thickness of material can be modified much faster than modifying each individual part. This also takes out the potential for error as long as your variables and equations are set up correctly.

Thanks for reading! Whether you have questions or need our contract services, please don't hesitate to contact us!