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.

Expression syntax. Addition does not work in expression, but multiplication does

nick_papageorge_dayjobnick_papageorge_dayjob Member, csevp Posts: 845 PRO
I must be missing something super easy here, but I could not find the answer searching help or searching the forum. I made a length variable d=28.3mm in the tree. Inside sketcher, when I type 8*#d, it works. If I type 8+#d, I get an error, and the expression won't solve. I tried using parenthesis, putting the plus on the other side of the d, using extra spaces, etc. What am I missing? Thanks.






Best Answers

  • nick_papageorge_dayjobnick_papageorge_dayjob Member, csevp Posts: 845 PRO
    Answer ✓
    I found the issue. It was the units. If I typed a mm in the expression, it worked. Or, if I changed the #d to be a unit-less number instead of a length, it worked.


  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    Answer ✓
    It is usually best to keep the units (in case somebody changes the workspace units). So the syntax should be 8mm + #d (where #d is in mm). 
    Senior Director, Technical Services, EMEAI

Answers

  • nick_papageorge_dayjobnick_papageorge_dayjob Member, csevp Posts: 845 PRO
    Answer ✓
    I found the issue. It was the units. If I typed a mm in the expression, it worked. Or, if I changed the #d to be a unit-less number instead of a length, it worked.


  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    Answer ✓
    It is usually best to keep the units (in case somebody changes the workspace units). So the syntax should be 8mm + #d (where #d is in mm). 
    Senior Director, Technical Services, EMEAI
Sign In or Register to comment.