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.

Using Variables (Invalid Equation)

craig_townsend418craig_townsend418 Member Posts: 20
I'm trying to learn how to use variables effectively to draw parts from a 1:1 drawing, to a scaled down version to 1:29 scale for my model train project. Using the variable feature, I created a variable labeled "Scale" that is 1/29 or .0344". When I dimension a part, I can then create a variable such as #Scale * 5 in, and get the part the correct scaled length using the 1:1 drawing dimensions. 

But my problem is this. I will eventually be exporting this file and creating a file for photo etching. The photo etching service has a minimum requirement for holes, slots, etc that is 1.2x the etch material thickness.

By using the same idea of creating a variable for scaling, I created another variable called Etch (0.022 the material thickness). Now when I draw a design, like the test document below (creating a slot in a feature) I want to ensure that the slot does not ever get smaller than 1.2 * #Etch (per the photo etching service requirement). I thought a variable such as Min(1.2 * #etch, #scale * 3 in) would ensure that the slot is never below the minimum required size of 1.2 * Etch (.026" actual), but also the correct scale width of .103". That said, when I type that formula in, I get a message that says invalid expression. 

What am I doing wrong in the equation that is causing this problem? I'm assuming its something simple that I'm missing. 




  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 3,038
    Does #etch have a unit? min(1.2 * #etch, #scale * 3 in) would not be valid unless both have a unit (inches).
  • rene_gourleyrene_gourley Member Posts: 1
    Hi Craig,

    As Neil said, you need to be careful about units.  In particular, #scale shouldn't have units because then you are multiplying inches times inches, which is inches squared, and that's an area not a linear dimension.  

    The other thing is that this equation will ensure that the dimension is the smaller of the two values.  If you want to ensure it is at least 1.2*#etch, then you need to use max().

    Good luck,
  • craig_townsend418craig_townsend418 Member Posts: 20
    Yes, #etch is .022". I will double check that I entered it as .022 in when I created the variable.
  • craig_townsend418craig_townsend418 Member Posts: 20
    Yes the #etch variable is assigned a unit. 

    I still can't figure out why it's giving me the invalid equation.
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 3,038
    edited March 2019
    @craig_townsend418 - I just looked at your doc and #Scale is different (in your image it says 1/29 - how did you do that?). Whereas in the doc linked above, #Scale has units of inch. Therefore, your equation would be an area. Maybe you changed it since posting?

    I tried your example above and it worked fine. While this does not answer your question, I strongly advise modeling your parts 1:1 then applying a Transform/Scale feature at the end - this will result in less confusion.
  • craig_townsend418craig_townsend418 Member Posts: 20
    I started drawing in 1:1 than used the transform to scale the entire thing down, but when working with a design for a photo etching this might result in a hole or slot that does not meet the minimum size of the part feature. You then have to go back and adjust that design feature. 

     My thought following Rene's advice (he is doing a similar project with etching) is that by introducing a variable #scale into the equation you can draw essentially at both 1:1 and scaled version at the same time eliminating possible problems with minimum part sizes. By using the #etch variable you can eliminate any conflicts.

    And yes, I played around with the #scale and the #etch variable after I posted the question. 

    Thanks to both of you for the help.
    Craig Townsend

Sign In or Register to comment.