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.

need help defining a formula value within a variable

john_lopez363john_lopez363 Member Posts: 110 ✭✭
I have this variable defined.  As you can see I am using two other variable definitions to define the value of a third variable.  As written it works just fine.  Im taking the #slat_width multiplying by a factor of .87 and then dividing by the #slat_slot_count to define the #slat_slot_distance.

What I NEED to do instead is subtract a value (70) from #slat_width variable then divide it by the #slat_slot_count variable. 

However when I replace the multiple (*) with the subtract (-) operator it fails.  What am I doing wrong/how do I fix this?





Best Answer

Answers

  • MichaelPascoeMichaelPascoe Member Posts: 1,989 PRO
    edited January 22 Answer ✓

    For multiplication and division, you can multiply a (value with units) by a (unitless value): 45in * 4
    However, for addition and subtraction, both values need to have similar units: 45in - 5m 

    So you could not do:
    45in - 5
    45in - 5in^2


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,688
    You are subtracting a number from a length (70mm? 70in? 70km?) - you need to define the units of the number.
    Senior Director, Technical Services, EMEAI
  • john_lopez363john_lopez363 Member Posts: 110 ✭✭
    Doh...such a simple thing!  Thanks @NeilCooke

Sign In or Register to comment.