Glenn Schroeder

How can I use a global variable or custom property value in a Feature?

Blog Post created by Glenn Schroeder on Dec 24, 2017

Some features allow Equations and linking directly in the Property Manager. (See 2018 SOLIDWORKS Help - Direct Input of Equations in PropertyManagers for the list.) It's as simple as typing the Equal sign in the dimension box to get the drop-down where you can make your selection. See below from a Linear Component Pattern in an Assembly.



This hasn't always been the case, and still isn't available for all features that use a dimension, but it can still be done. If you can't do it directly in the Property Manager go ahead and create the feature, using a value that's close to what you need, and click Okay to close the feature. Now there are two options for linking the dimension.


1. Single-click on the feature in the tree to show the dimension in the graphics area (or double-click if you don't have Instant 3d turned on).



Double-click on it to bring up the standard dimension dialog box, enter the Equal sign, and you'll get the same drop-down shown above. You'll need to do a manual rebuild for the change to take effect.



..or option 2: Open your Equations dialog box and go to the "Dimensions" tab. All dimensions in the model will be listed. Remove the value in the "Value / Equation" column and enter the Equal sign. That will give the same options for linking. (Naming dimensions will be a big help if you want to use this option. That will make it much easier to find the one you need.)




By the way, I believe in giving credit where it's due. I learned about this second option from Frederick Law at Global variables in "Thicken" feature?.


2020-05-19 edit:  Since posting the above I've run across a situation where neither of the above solutions works.  There's no way (that I can find) to directly reference dimensions in a "Move/Copy Bodies" feature.  The best option I've found is to use something else, like a plane or sketch, to drive the feature.  One example would be when needing to use the "Constraints" portion of the feature to apply a Distance mate.  The alternative would be to create a Plane offset the desired distance, then use a coincident Mate with this Plane instead of a Distance Mate.  The plane value can be linked to a global variable, or configured as needed, which will produce the same result as linking directly in the feature.