What is Parametric Modeling?

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).

How will Valor utilize Parametric Modeling?

Valor has a FeatureScript called Valor Variables that provides 4 features to OnShape users:

  • Valor General Variables
  • Valor 3D Print Variables
  • Valor Router Variables
  • Valor Mill Variables

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.

How to use the Valor FeatureScript

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.

feature_script.png

Then the picture below shows an example Feature Tree that a student would have when they inserted all 4 features.

feature_tree.png

Import the Valor FeatureScript

If you do not have the ValorFeatureScript imported, click the Add custom features button shown below:

feature_script_import.png

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

Viewing the available parameters

To view the available variables, click on the Custom Tables button in the right panel of OnShape as shown below:

feature_script_table.png

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:

feature_script_import_2.png

The end result after you have imported the tables should look like this:

custom_table.png

You now can scroll through and read all of the variables and their values!

Using the parameters

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:

feature_tree.png

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:

var_usage.png

Updating the Parameters

At this point, if a mentor (or supervised student) updates the FeatureScript, all instances of the variables in any document will update!

Quiz

The quiz for this unit will be submitting a screenshot of an OnShape document that looks like the screenshot below:

onshape_screenshot.png

Requirements for the screenshot:

  • Must include all 4 Valor variable features in the feature list
  • Must have your name as the document name
  • Must include the custom table tab open and showing one of the Valor variable selections
  • No labels