Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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_boulet
Member Posts: 65 ✭✭✭
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 ?
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
Tagged:
0
Best Answer
-
francois_boulet Member Posts: 65 ✭✭✭Thank you guys !
Thanks for your first link Bruce.
It lead me to Brian Brady's comment:brian_brady said: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 Vinci1
Answers
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.
And another thread on expressions
Thanks for your first link Bruce.
It lead me to Brian Brady's comment:
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 !
Léonard de Vinci
Take that variable and define it in a configuration.
So since no one actually answered this simply enough, I will.
So FFR:
There is a max(x, y) and min(x, y) conditional you can use.
BUT THESE DO THE OPPOSITE OF WHAT YOU THINK
max(6, 8) will return 8 as it is the bigger number.
min(2, 4) will return 2 as it is the smaller number.
The order of the numbers don't matter.