Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Parametric vs Configuration Variables article

alan_baljeualan_baljeu Member, User Group Leader Posts: 111 ✭✭
https://learn.onshape.com/learn/article/parametric-variables-vs-configuration-variables

This article has a few points where the statements really could use demonstration or clearer example.  I managed to puzzle through a bunch, but this one has me stuck:

  • Parametric variables allow a multitude of inputs because they are considered features. You can define the value of a Parametric variable off of a user inputted value, dimension, formula, another variable, or any combination of them.
I don't know how to use anything other than a formula.  How do I reference a dimension in a variable?

Creating knowledge-driven design automation software, for molds, etc.
www.virtualmold.com

Answers

  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,938 PRO
    Only way I know how to set a dimension to a parametric variable is to create the variable in featurescript.

    here is the most common example: https://cad.onshape.com/documents/77baa8153589a7fc5f289829/v/ceb4a03e4ac77173bf6d0074/e/181cb871f3008e6b885df46a
  • romeograhamromeograham Member, csevp Posts: 682 PRO
    The other way to "use" a dimension as a Parametric Variable is to use the excellent Measure Value featurescript.
    You can use it to measure the dimension you want to use later, and create a variable that you can use directly, or however you want later.

    Here we have a dimension (5cm) that we want to use later as a variable:
    Then we use the Measure Value FS to create a Variable (I called it #length) to use later:

    Now, #length is available to use any way you'd like. We can use it to set the length of a blind extrude:

    Or as a variable in an expression:

    ...which updates nicely when I change the dimension in the first sketch:

    You can use the Measure Value FS to measure quite a few different things.

    One of the interesting things about Parametric Variables, too, is that you can set a new value further down the Feature List. Onshape will solve for #length using what ever value is valid at that point in the Feature List:

    You can even use a Variable inside itself. This is useful for accelerating or variable pattern work (search for @NeilCooke 's "pretty patterns" posts / documents and this webinar for great learning materials).

    Good luck!
    Romeo
Sign In or Register to comment.