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.

Configurations & if Statements

N_McCluskeyN_McCluskey Member Posts: 4 PRO
Hi,

I am coming from Solidworks and i would have normally put a simple if statement in the dimensions to get the desired result but that is not the case in onshape.

I have a model of a pin and a hole. Currently the pin has a variable of #PinD and basically I want to incorporate the following if statement for the hole

If ( #PinD * 1.2 > #PinD + 3 , #PinD * 1.2, #PinD + 3 )

Basically the hole to be which ever size is grated,  #PinD * 1.2 or #PinD + 3

What is the best way to add this into the model?

Best Answers

  • TimRiceTimRice Member, Moderator, Onshape Employees Posts: 304
    edited July 12 Accepted Answer
    Our numeric inputs are actually quite flexible. This is possible using a ternary operator, as seen in the example below:


    This applies to any numeric input in our product (both part studios and assemblies).
    Tim Rice | User Experience | Support 
    Onshape, Inc.
  • N_McCluskeyN_McCluskey Member Posts: 4 PRO
    Accepted Answer
    Brilliant, it was the brackets and units that I missing out. 

Answers

  • TimRiceTimRice Member, Moderator, Onshape Employees Posts: 304
    edited July 12 Accepted Answer
    Our numeric inputs are actually quite flexible. This is possible using a ternary operator, as seen in the example below:


    This applies to any numeric input in our product (both part studios and assemblies).
    Tim Rice | User Experience | Support 
    Onshape, Inc.
  • N_McCluskeyN_McCluskey Member Posts: 4 PRO
    Accepted Answer
    Brilliant, it was the brackets and units that I missing out. 
Sign In or Register to comment.