Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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_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.
https://cad.onshape.com/documents/a1aef4f0f35168b27c2f9cf5/w/ee4c40ebba00bc5b2b6cac6a/e/31db9e70b3eef15f98d19701
Craig
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.
https://cad.onshape.com/documents/a1aef4f0f35168b27c2f9cf5/w/ee4c40ebba00bc5b2b6cac6a/e/31db9e70b3eef15f98d19701
Craig
0
Comments
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,
Rene
I still can't figure out why it's giving me the invalid equation.
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.
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