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.
Numeric Fields with Multiple Length Divisions and Additions
nicholas_aarestad
Member Posts: 14 EDU
Hello all, I've run into a bit of a roadblock using numeric fields with multiple configuration variables.
I am attempting to define a configuration variable's upper limit as a function of other configuration variables. Specifically, the (approximately) correct equation is:
(#X / 2) - (#Y / 2) - 1in
Where #X and #Y are both lengths.
However, while I've tried a bunch of different ways of phrasing this, I can't seem to find one that Onshape will accept.
Specifically, I've tried:
(#X / 2) - (#Y / 2) - 1in
((#X / 2in) - (#Y / 2in) - 1)in
#X / 2 - #Y / 2 - 1
I've found a previous question which lead me to the reference manual's page on numeric fields (super interesting!) but all of its examples involving length are extremely basic.
Can anyone guide me in the right direction with this?
Thanks in advance!
I am attempting to define a configuration variable's upper limit as a function of other configuration variables. Specifically, the (approximately) correct equation is:
(#X / 2) - (#Y / 2) - 1in
Where #X and #Y are both lengths.
However, while I've tried a bunch of different ways of phrasing this, I can't seem to find one that Onshape will accept.
Specifically, I've tried:
(#X / 2) - (#Y / 2) - 1in
((#X / 2in) - (#Y / 2in) - 1)in
#X / 2 - #Y / 2 - 1
I've found a previous question which lead me to the reference manual's page on numeric fields (super interesting!) but all of its examples involving length are extremely basic.
Can anyone guide me in the right direction with this?
Thanks in advance!
Tagged:
0
Best Answer
-
ilya_baran Onshape Employees, Developers, HDM Posts: 1,210Ah, yes, I didn't read the original post carefully enough. Yes, you can't use a configuration variable to define a limit on another configuration variable.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc5
Answers
#X/2 - #Y/2 - 1 in
example:
https://cad.onshape.com/documents/097cd417dd0132907147b98d/w/829548ea8fccc921c00968ba/e/47a28d79fb61d6a117853a34
The problem with the second expression, ((#X / 2in) - (#Y / 2in) - 1)in is that #X / 2in is an area, not a number (as one might think) -- the unit here is multiplied, not divided -- e.g., 1/2 in is half an inch. Doing (#X / (2 in) - #Y / (2 in) - 1) in will do what you intended.
The problem with the third expression is you're subtracting a number (1) from a length #X / 2 - #Y / 2
Hope this helps.
While I thought that this was originally a syntax thing, I can see now that the error message this gives me is "Enter a Number or Number with Units" which I suppose might imply that a function of other Configuration Variables or Variables is not a valid input, so it's probably more related to me not understanding the limitations on the feature.