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.

Cannot resolve an expression to make a dimension dependent of 3 variables. Someone can help ?

francois_bouletfrancois_boulet Member Posts: 65 EDU
I'm not familiar with scripting. Maybe this is a very simple problem.
PLease see the attached PDF file ...
La simplicité est la sophistication suprême.
Léonard de Vinci

Best Answer

  • francois_bouletfrancois_boulet Member Posts: 65 EDU
    Answer ✓
    It Works, Thank you.
    And I found another way to do it with a conditional: (#ObstaAv>0?0:#Diff/#ObstaArr) in
    Thanks again !
    La simplicité est la sophistication suprême.
    Léonard de Vinci

Answers

  • KrzKrz Member, Developers Posts: 68 ✭✭✭
    You have incompatibe units.
    1st equation ([in]/[in])*[in] - ([in]) = [in]-[in] = [in] OK
    2nd eq: ([in]/[in])*[in] - ([in]*[in])*[in] = [in] - [in]^3  KO
    3rd eq: ([in]/[in])*[in] - ([in]*[in]) = [in] - [in]^2  KO

    So
    2nd eq should be: (#Diff/#ObstaArr) in-(#Diff*#ObstaAv)/in
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    @francois_boulet

    #Diff and #ObstaAv both have "in" as their unit already.  When multiplied together, the unit becomes in^2 (as expected for multiplying two lengths together).  Your expression will work if you do:
    ((#Diff * #ObstaAv) / in)

    but I suspect that what you actually meant to do is have ObstaArr and ObstaAv as unitless numbers instead of lengths?  Then your expression would look like:
    (#Diff / #ObstaArr) - (#Diff * #ObstaAv)

    But that's just a guess, and I can't tell your design intent.  You can set a variable to a number instead of a length using the "Number" option at the top:



    Jake Rosenfeld - Modeling Team
  • francois_bouletfrancois_boulet Member Posts: 65 EDU
    Answer ✓
    It Works, Thank you.
    And I found another way to do it with a conditional: (#ObstaAv>0?0:#Diff/#ObstaArr) in
    Thanks again !
    La simplicité est la sophistication suprême.
    Léonard de Vinci
Sign In or Register to comment.