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.
Why can I not use variables in math expressions?
Kevin_Beitel
Member Posts: 1 ✭
It seems that existing variables are not valid in math expressions. I get a valid expression when defining #Y as a value of #X/2, but #X^(1/2) or sqrt(#X) are invalid expressions. Is this not allowed or am I doing something wrong?
0
Best Answer
-
kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565Right, an operation like sqrt(1 meter) isn't well-defined: Does it mean 1 meter? 10 centimeters? Or nothing at all? Onshape says the latter
If #X has length units, you can use an expression like sqrt(#X / inch) * inch, which is well-defined.
3
Answers
If #X has length units, you can use an expression like sqrt(#X / inch) * inch, which is well-defined.