There are plenty of times when you know the range of values you need when creating variables, which has been covered in previous Tech Tips (Creating Variables and How to Use Variables in Patterns to Vary Features).
For those cases where your variable value needs to depend on an existing piece of geometry, Onshape has Driven Variables.
These variables give you the capability to create a reusable, parametric variable without needing to type in an explicit value. They can be used for measuring distances, lengths, and diameters/radii, each of which will be covered in this blog.
Distance Between Points as a Driven Variable
The measure distance option allows you to select two points and use the minimum or maximum distance between them as a value downstream. For distances between circular faces, use the “Use Axis” option in the dialogue box to get the center distances between the two circular faces. Additionally, you have the option to specify an axis measurement for the variable between the shortest path distance, distance in the X, Y, or Z directions, or a custom path.
The ability to measure distances between points is most commonly used when working with patterns and can be used to drive variables. Whereas with an explicitly created variable, you need to know the exact distances between patterned instances and if the pattern changes you need to go in and manually update the instancing of the pattern, Driven Variables give you the ability to have this parametrically driven in the pattern.
Length as a Driven Variable
Using length as a Driven Variable gives you the ability to test out different sizes for something and see the downstream effects of all the changes. For instance, in the frame example provided below, the entire skeleton structure for the frame is based on the measured length of a side on the base. All proportional relationships relate directly back to the variable, and as the size of the frame changes during the development process to try to find the exact right size, the entire model updates parametrically.
Diameter as a Driven Variable
The diameter option allows you to create a measured variable based on either the diameter or radius of an existing piece of geometry. This is useful when working with in-context models like the frame structure shown below. The frame structure is created in its own Part Studio and then the footing of the frame is created in a separate one. Using the measured variable, a plate for the frame to be mounted on is created and given a fillet that is equal to the measured value of the fillet of the frame. This allows you to quickly create these designs on the fly without having to measure out the pre-existing fillets on the edge of the 80/20 frame.
Want to learn more about Driven Variables? Check out our Help Center content on it! Or watch the video below:
You can also review the most recent technical blogs here.