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.

Is it possible to set a minimum & maximum value for a sketch dimension ?

francois_bouletfrancois_boulet Member Posts: 65 EDU
Using variables or otherwise, is it possible to set a minimum & maximum value for a sketch dimension ?
Giving different values to some variables affecting the mentioned dimension, I want to be able to choose the value of that dimension and make sure that the result will stay between some defined limits.
The link: 
https://cad.onshape.com/documents/6de388c6d4ffa687115fa4a3/w/c2519130b0ffff206097bbc8/e/997c32e1b83badc941474d66
Included; the Part studio and a PDF

The real question might be: Is it possible to have a conditional value in the last part of the formula ?

La simplicité est la sophistication suprême.
Léonard de Vinci

Best Answer

  • francois_bouletfrancois_boulet Member Posts: 65 EDU
    Answer ✓
    Thank you guys !
    Thanks for your first link Bruce.
    It lead me to Brian Brady's comment:
    You can also nest conditionals by placing another complete conditional statement in either the true or false positions. I suggest using parentheses around the second statement (may even be necessary) for readability.   #width<4?1:(#width>4?3:2)

    Now I can say:
    It is possible to set Min & Max value for a sketch dimension using variables and conditional expression. (See the updated PDF)

    Thanks again to you guys.
    This Forum is great !


    La simplicité est la sophistication suprême.
    Léonard de Vinci

Answers

  • 3dcad3dcad Member, OS Professional, Mentor Posts: 2,470 PRO
    edited April 2018
    The easy answer would be no, it's not possible to set limits using variables.

    But as you can control variable values using feature script where you can set conditions according to user input I would say this is possible to achieve with Onshape.

    Edit: As it appears you can do this also without fs.
    //rami
  • bruce_williamsbruce_williams Member, Developers Posts: 842 PRO
    Here is good post on expressions (including conditionals) by @lougallo

    And another thread on expressions
    www.accuratepattern.com
  • francois_bouletfrancois_boulet Member Posts: 65 EDU
    Answer ✓
    Thank you guys !
    Thanks for your first link Bruce.
    It lead me to Brian Brady's comment:
    You can also nest conditionals by placing another complete conditional statement in either the true or false positions. I suggest using parentheses around the second statement (may even be necessary) for readability.   #width<4?1:(#width>4?3:2)

    Now I can say:
    It is possible to set Min & Max value for a sketch dimension using variables and conditional expression. (See the updated PDF)

    Thanks again to you guys.
    This Forum is great !


    La simplicité est la sophistication suprême.
    Léonard de Vinci
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    Configurations allow for variable input range.

    Take that variable and define it in a configuration.


Sign In or Register to comment.