With a Variable Studio in Onshape, you can create variables that can be referenced throughout your Document, allowing you to drive multiple features of your design from a single location.
When creating a Variable Studio there is an Insert into all Part Studios and Assemblies checkbox at the bottom of the tab that is often overlooked:
This option impacts both the performance and control of your design, especially if you are branching and merging in Onshape.
With this option enabled, all variables in this Variable Studio are automatically linked and can immediately be used in every Part Studio and Assembly in the current Document. No extra work is required to take advantage of the variables.
Making a change to any variable’s value automatically updates all Part Studios and Assemblies that use them. While this is convenient, it can cause challenges when you branch and merge.
If you use a workflow that includes branching and merging, changing a variable in your design changes every Part Studio and Assembly in your design, not only the parts impacted by the variable change. In the image above, changing a single variable impacts 38 tabs. This can make it hard to keep track of exactly what has changed during a merge.
If you instead disable the Insert into all Part Studios and Assemblies checkbox, Onshape no longer links the Variable Studio variables to all Part Studios and Assemblies. Instead, you now must manually link the variables you want to reference in the relevant Part Studios or Assemblies. This is done by using the Insert Variable Studio button at the bottom of the Part Studio or Assembly’s Variable table panel:
This opens a dialog where you can select any variables created not only in any Variable Studio in the current Document, but also in any Variable Studio in another Document:
Once the variables you want to use are inserted, you can reference them as you would any other variable in a design. Now, if you change a variable in your Variable Studio, only those Part Studios and Assemblies referencing that variable show a change when performing a merge. In the image below, there are only 12 tabs impacted by changes:
This is an important consideration when using variables in conjunction with branching and merging. You should also consider unchecking this option for performance reasons. It is not recommended to include every variable you create in a Variable Studio in every Part Studio and Assembly unless there is a practical reason to do so. Otherwise, you are including unnecessary additional data in each of those tabs.
This Tech Tip helped you understand the Variable Studio automatic insert option and how it can impact managing your design with branching and merging. If you want to learn more about Variable Studios, check out this course in the Onshape Learning Center.
If you want to learn more about branching and merging in Onshape, this course, also found in the Learning Center, is a great place to start.
Interested in learning more Onshape Tech Tips? You can review the most recent technical blogs here.
The Onshape
Learning Center
Take self-paced courses, get technical briefings,
watch informational webinars, or sign up
for an instructor-led training session.