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.

Multiple Variables in Single Expression

Andrew_YoderAndrew_Yoder Member Posts: 2
So I was trying to confine the dimensions of a box I made with variables, so that the whole box will regenerate with target values by changing any one of the variables. Normally this would be easy, using just x,y, and z vairables. However, the dimensions I wanted to input outside the sketch were for the object entering a slot inside the box, so to change the overall dimension to the right size I added a variable for tolerance (that I could change later if the slot didn't fit) and then tried to make to make a composite variable that represented the whole length of the slot(): 2#tol + #length (naming arbitrary). Sometimes using 2 variables does work, but for the most part the computer doesn't recognize it as an expression. And this problem works with any name I could think of, single letters or long words. Going into the forum, tutorials, or otherwise, no one seems to have tried using this. How can I achieve making a CAD that changes itself to specifications just by editing the global variables, without using more than one variable?

Answers

  • Andrew_YoderAndrew_Yoder Member Posts: 2
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,173
    I think based on your screenshot that your variable solW does not have units -- change the variable to "2.33 in" and you should be fine.  Similarly #thic

    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Gavin_MunroGavin_Munro Member Posts: 14 PRO
    most of the time, if I find that I have expression that doesn't work, it's because I get the brackets in the wrong place or misstype one of the variables. It would be good to be able to expand the view of the expression to fit the text length, so you can see all the elements at once.
  • neil_4neil_4 Member Posts: 3
    Still no answer on this? I'm having the same problem. 
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    @neil_4 ,

    The answer here was that he was trying to add a unitless value to a length.
    Jake Rosenfeld - Modeling Team
Sign In or Register to comment.