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't I pass a value with units to an opThicken
Chris_D_Mentes_001
Member, csevp Posts: 103 PRO
Why can't I pass a value with units to an opThicken unless it's passed in as a variable from function parameter definition:
https://cad.onshape.com/documents/c8eef2271809c4293325c9b1/w/d82cceae829e190d1649e512/e/287a2ff37d6f3ee70d59456f (for onshape team only).
see line 61 to 69 and note that this all works with no errors if I replace "1e-6*meter" with "offset" both of which are valueWithUnits but behave differently:
https://cad.onshape.com/documents/c8eef2271809c4293325c9b1/w/d82cceae829e190d1649e512/e/287a2ff37d6f3ee70d59456f (for onshape team only).
see line 61 to 69 and note that this all works with no errors if I replace "1e-6*meter" with "offset" both of which are valueWithUnits but behave differently:
var th1 = offset<0?-1e-6*meter:0; var th2 = offset>0?1e-6*meter:0; println(th1 ~ " - " ~ th2); println(offset); opThicken(context, id + "TemporaryThickness", { "entities" : faces, "thickness1" : th1, "thickness2" : th2 });the above code gives error: @opThicken: INVALID_INPUT
Tagged:
0
Best Answer
-
caden_armstrong2 Member, User Group Leader Posts: 127 ✭✭✭A few things I notice:
your th1 and th2 base case has no units. You need to replace 0 with 0*meter.
You are comparing offset to a value without units.
Additionally, you have a negative value for th1, both inputs for opThicken need to be positive.
2
Answers
your th1 and th2 base case has no units. You need to replace 0 with 0*meter.
You are comparing offset to a value without units.
Additionally, you have a negative value for th1, both inputs for opThicken need to be positive.