Skip to main content
14-Alexandrite
June 28, 2013
Solved

Creo relation in Mathcad.

  • June 28, 2013
  • 9 replies
  • 5351 views

I am wondering how i can write a Creo Relation in Mathcad 15.

In Creo the relation looks like this:


IF MOD_WIDE == 4


LEFT_BAY_MOD_WIDE = 2

ELSE


LEFT_BAY_MOD_WIDE = 3

ENDIF

So when the variable MOD_WIDE is defined as 4, then the other variable LEFT_BAY_MOD_WIDE is set equal to 2, otherwise it is 3.

Any suggestions?

Best answer by Werner_E

OK, Mathcad has a lot of equal signs with different meaning - you see three of them in both of my posts.

1) ":=" This is the assignment sign. You get it by simply typing ":" or you can use it from the evaluation toolbar

2) "=" The (bold) boolean equal sign; you use it to compare values; you get it by typing Ctrl&+ or take it from the Boolean toolbar

3) "=" the evaluation equal sign used to numerically evaluate the LHS; get it by typing the normal "=". There is a preference setting which results that when you type on the LHS a variable which is not defined and then the normal = you get a :=

I attach the worksheet for your convenience

9 replies

Werner_E
25-Diamond I
June 28, 2013

Creo_If.png

24-Ruby IV
June 29, 2013

Better so - for Mathcad 15, Prime and Express:

Left.png

Werner_E
25-Diamond I
June 29, 2013

Any special reason for that preference other than that we would have to replace "otherwise" for "else" (or "elseif") in Prime?

Personally I prefer the programmed variant as I feel its a more clearly representation, especially when it comes to nested branches. But I think its a matter of peronal taste.

If shortness matters one could use in this case the following, but I wouldn't recommend it:

Creo_if2.png

BTW it works, because in MC FALSE=0 and TRUE=1.