Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

expressions unit conversion in if case ( Angle / dimension )

Status
Not open for further replies.

Robse

Industrial
Jun 30, 2015
17
0
0
CH
Hello,

I want to make an angle A (deg) directly dependent to a dimension D (mm) with expressions.

I try to generate an angle of 17.5 degrees unless the measurement is greater than 75mm. When i type:

A = if(D<=75)(10)else(17.5)

then I get an unit error. Is there any solution to convert dimensions to a format that works with an if statement without converting it before to a different unitless expression?

Thank you and best regards
 
Replies continue below

Recommended for you

Hello,

thank you for your answer. Maybe i didn´t explain it properly.

The problem is D is a Diameter and the unit is mm. How do i use multiple units or is there any possibility to convert?

Best regards
 
In the expression system, any hard coded numbers in the formula are assumed to be in the same units as the expression. In your case, it thinks 75 is a measurement angle in degrees and throws an error when comparing a length (expression D, defined in mm) to an angle. To fix this, you need to tell it the units for the 75 number.

Code:
 if(D<=75[mm])(10)else(17.5)

www.nxjournaling.com
 
Status
Not open for further replies.
Back
Top