Parametric modeling is a modeling process with the ability to change the shape of model geometry as soon as the dimension value is modified. Parametric modeling is usually implemented through a script to define the dimension and the shape of the model. The model can then be re-rendered in CAD with the new dimensions defined in said script. It is quite common that a parametric model uses feature-based, modeling tools to manipulate the attributes of the model (aka. OnShape).
Valor has a FeatureScript called Valor Variables that provides 4 features to OnShape users:
Each feature can be imported as a feature into the feature tree of a CAD model, and it then provides variables that users can use. The idea is that students can import any of the 4 (or all 4 if they need them!) features into their part studio and use pre-set variables that the mentors on the FRC team filled in. These variables are typically global variables that never change, and are not specific to a subsystem.
FeatureScripts are a useful way in OnShape of importing code snippets, features that can be used in the CAD document, and other useful tools. For more information on what a FeatureScript is, see: https://cad.onshape.com/FsDoc/
The following picture shows the OnShape toolbar where you can select and insert a Valor Variable into your feature tree.
Then the picture below shows an example Feature Tree that a student would have when they inserted all 4 features.
If you do not have the ValorFeatureScript imported, click the Add custom features
button shown below:
Then, paste the following link to import the feature:
https://cad.onshape.com/documents/a764bc0ce6246cd002711be8/w/c16e0f2d5d1a83f79e631390/e/6a0339ea2a6c1839de05f2c5
You will now have the FeatureScript imported into your toolbar
To view the available variables, click on the Custom Tables
button in the right panel of OnShape as shown below:
If the tables are not available, you will need to add the tables from the same FeatureScript link above. It is also copied and pasted here:
https://cad.onshape.com/documents/a764bc0ce6246cd002711be8/w/c16e0f2d5d1a83f79e631390/e/6a0339ea2a6c1839de05f2c5
When selecting which tables to import, import all tables under the Valor Variables script. You should see the following image after pasting the link when adding custom tables:
The end result after you have imported the tables should look like this:
You now can scroll through and read all of the variables and their values!
To use the variables, make sure you insert the feature that includes the variables you want to use. Like above, you should see this in your feature tree after inserting each feature:
Now, you will be able to use any of the variables shown in the tables!
To use in a dimension or an extrude (or similar features), enter a hash tag (#) and then the variable name. Use tab to auto-complete.
An example of using a 10-32 hole diameter variable is shown below:
At this point, if a mentor (or supervised student) updates the FeatureScript, all instances of the variables in any document will update!
The quiz for this unit will be submitting a screenshot of an OnShape document that looks like the screenshot below:
Requirements for the screenshot: