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.

Equation not working. Need help

Research_01Research_01 OS Professional, Mentor, Developers Posts: 301 PRO
edited November 2017 in Community Support
I have this equation for a dimension using variables:

(245-((#ARC1+#ARC2)))/2

The first minus sign after 245 is the problem. When digging into this to see what is wrong, If I try a minus, plus, division operator it does not work. If I try a multiplication operator it does work. 

(245-((#ARC1+#ARC2)))/2 gives error "enter a valid function"
(245+((#ARC1+#ARC2)))/2 gives error "enter a valid function"
(245/((#ARC1+#ARC2)))/2 gives error "enter a valid function"
(245*((#ARC1+#ARC2)))/2 works

What am I doing wrong or is this a bug?

Best Answers

  • Research_01Research_01 OS Professional, Mentor, Developers Posts: 301 PRO
    Answer ✓
    Do either of the variables have units? It might be worth removing the units from the variables and adding them in the dimension instead.
    No units they are copy and pasted from the dialog

Answers

  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    did you tried (245-(#ARC1+#ARC2))/2 or (245-#ARC1- #ARC2)/2 ?
  • abefeldmanabefeldman Member Posts: 166 ✭✭✭
    Do either of the variables have units? It might be worth removing the units from the variables and adding them in the dimension instead.
    Abe Feldman
    UX/PD/Community Support
  • Research_01Research_01 OS Professional, Mentor, Developers Posts: 301 PRO
    Answer ✓
    Do either of the variables have units? It might be worth removing the units from the variables and adding them in the dimension instead.
    No units they are copy and pasted from the dialog

  • Research_01Research_01 OS Professional, Mentor, Developers Posts: 301 PRO
    did you tried (245-(#ARC1+#ARC2))/2 or (245-#ARC1- #ARC2)/2 ?
    Neither of these work unfortunatley

  • lanalana Onshape Employees Posts: 689
    @Ben_
    Does (#ARC1+#ARC2) / 2 work?
  • Research_01Research_01 OS Professional, Mentor, Developers Posts: 301 PRO
    lana said:
    @Ben_
    Does (#ARC1+#ARC2) / 2 work?
    Yes that portion of the equation works but as soon as I try and subtract it from 245 is does not
  • abefeldmanabefeldman Member Posts: 166 ✭✭✭
    Testing this out I set

    ARC1 = 45 deg
    ARC2 = 45 deg

    All of the equations but the last fail because 245 does not have consistent units with either of the variables.

    Changing the variables to the "Any" unitless option succeeds:

    ARC1 = 45
    ARC2 = 45

    Or you could enter ((245*deg)-(#ARC1+#ARC2))/2, but be sure there's no "deg" unit appended to the end.
    Abe Feldman
    UX/PD/Community Support
  • Research_01Research_01 OS Professional, Mentor, Developers Posts: 301 PRO
    edited November 2017
    Testing this out I set

    ARC1 = 45 deg
    ARC2 = 45 deg

    All of the equations but the last fail because 245 does not have consistent units with either of the variables.

    Changing the variables to the "Any" unitless option succeeds:

    ARC1 = 45
    ARC2 = 45

    Or you could enter ((245*deg)-(#ARC1+#ARC2))/2, but be sure there's no "deg" unit appended to the end.
    I have not used degree units! The ARC1 and ARC2 are lengths defined only by a number in my document (FYI they are arc lengths not arc degrees)

  • Research_01Research_01 OS Professional, Mentor, Developers Posts: 301 PRO
    I need to eat a little crow now... In the end if I added mm to the 245 it works thus (245mm-(#ARC1+#ARC2))/2 works but (245-(#ARC1+#ARC2))/2 does not. 
  • Research_01Research_01 OS Professional, Mentor, Developers Posts: 301 PRO
    It would be nice if the variables defaulted to unitless. IMHO
Sign In or Register to comment.