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.
How to use a pre-defined variable as an argument inside a math function?
john270
Member Posts: 2 ✭✭
I've been struggling to figure out how to use a pre-defined variable as an argument inside a math function such as floor(x) or ceil(x). I can get a real number to work fine as the argument, but every time I use a variable expression such as floor(#length) where the #length has been previously given a decimal real number value through a configuration table, it returns with the error of "Invalid Expression". Yet I see instructions to do this very thing in several Learning Center videos. Am I missing a correct syntax format to do this? I just can't find any documentation of how to use the variables inside functions. I would appreciate the help.
0
Answers
floor(#length / in) * in
The division converts the length into a number of inches, and the multiplication converts the floored result back to a length.