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.

Options

A little more on configuration.

brian_pinder662brian_pinder662 Member Posts: 119 ✭✭
I am trying to enter the following variable into a dimension box   #PipeRad21mm ? 105mm : 99.8066mm       What I am trying to say is (If the PipeRad is 21mm then this dimension is 105mm otherwise it is 99.8066mm)
but the the dimension box will not accept this saying please enter a valid expression
Could anyone please say where i am going wrong
Any help will help me to move on.  Best Regards Brian.

Best Answers

Answers

  • Options
    ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,175
    Unfortunately, the reality of computer math is that a tolerance is best for such comparisons.  You can use
    tolerantEquals(#PipeRad, 21 mm) ? 105 mm : 99.8066 mm
    and unlike == it'll be robust to rounding errors if #PipeRad is computed in any way other than evaluating the expression "21 mm"
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Options
    brian_pinder662brian_pinder662 Member Posts: 119 ✭✭
    Thank you all for your help, getting there slowly. Watched variable webinar several times but couldn't quite get it. afraid things don't sink in as quick when you get my age. Once again many thanks, Moving on.  Brian
  • Options
    brian_pinder662brian_pinder662 Member Posts: 119 ✭✭
    John, thanks for taking the time to give this detailed explanation, going to print it off for careful study and more practice.
    all the best Brian.
Sign In or Register to comment.