Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

If statement not possible with mixed units? 1

Status
Not open for further replies.

Jim0914

Mechanical
Sep 9, 2015
21
In the Expression statement "If(Angle>0)(dimension1)else(dimension2) the variable Angle is in units of degrees and dimension1 and dimension2 are in units of inches. I get an error because of mixed units. Why is this not possible? I want one dimension for a positive angle and another dimension if the angle is negative. How can I accomplish this?

Thanks in advance,

Jim Weisner
Senior Designer

 
Replies continue below

Recommended for you

Any constants in the formula are interpreted as being in the units of the expression. It thinks that you are trying to compare an angular value to an inch value. To make it understand, you will need to specify the units on the number that you are comparing to.

Try this:
Code:
If(Angle>0[highlight #FCE94F][degrees][/highlight])(dimension1)else(dimension2)

www.nxjournaling.com
 
Nice trick !
I'll remember.

"My english is bad ? That's why i'am french."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor