Skip to main content
Mar 31, 2017 11:10 AM UTC
Question

Logic in relations with parameters

Dear community,

I would like to use the logic operations in the relation of a parts. But I have a failure message that I don't understand.

IF UNIT = G

error Logischer Ausdruck erwartet.

QUANTITY = MASSE

ELSE

QUANTITY = 1

ENDIF

Thanks in advance for you help.

Pascal

4 replies

Mar 31, 2017 1:17 PM UTC

If you want to compare values, you'll need to use "double equal-sign"

IF UNIT == G

   QUANTITY = MASSE

ELSE

   QUANTITY = 1

ENDIF

phirschiAuthor
Apr 3, 2017 7:03 AM UTC

Hi,

Thanks for you reply. The logical test now works but I still have a failure message.

The message is in German, but it means

"Relations contain running conditions and can't be sorted by"

Failuremessage.JPG

Thanks in advance for your help.

Pascal

Apr 5, 2017 7:10 AM UTC

That is as designed by PTC.

You can NOT use "Sort Relations" if there's an "IF THEN ELSE" statement in your relations.

You just have to be very carefull writing relations, making sure they are in the correct order.

Mar 31, 2017 1:46 PM UTC

MASSE will have to be a real value.