Skip to main content
Jun 11, 2025 8:26 PM UTC
Acknowledged

Creo Relations Add ELSEIF for IF statements

Related products:Creo Parametric

1. Describe the Problem

Creo Relations IF statements are missing ELSEIF or ELSE IF ability: https://support.ptc.com/help/creo/creo_pma/r11.0/usascii/index.html#page/fundamentals/fundamentals/Conditional_Statements_in_Relations.html

 

Most languages have ELSE IF (ex: C# https://www.w3schools.com/cs/cs_conditions_elseif.php or C++ https://www.w3schools.com/cpp/cpp_conditions_elseif.asp)

 

ELSEIF provides:

  • Less verbose relations that are easier to read and write (see example below).
  • Clear intent that only one of these IF, ELSEIF, or ELSE statements should be evaluated.
  • Potentially faster evaluation of the relations. If one of the IF or ELSEIF statements are met, none of the remaining ELSEIF or ELSE statements need to be evaluated.

Presumably Creo would use ELSEIF (without a space) to match the lack of space in the current ENDIF.

 

Current workaround 1 (lots of separate IF statements): Not always clear if only 1 of the IF statements should be evaluated (this simple example is clear).

IF d1 > d2
length = 14.5
ENDIF
IF d1 < d2
length = 9.0
ENDIF
IF d1 == d2
length = 7.0
ENDIF

Current workaround 2 (IF statements nested in ELSE statements). This can get VERY hard to read on more complicated examples.

IF d1 > d2
length = 14.5
ELSE
IF d1 < d2
length = 9.0
ELSE
IF d1 == d2
length = 7.0
ENDIF
ENDIF
ENDIF

Future Relations using ELSEIF:

IF d1 > d2
length = 14.5
ELSEIF d1 < d2
length = 9.0
ELSEIF d1 == d2
length = 7.0
ENDIF

The ELSEIF example above is easy to read/write and is clear that only 1 of the LENGTH= statements should be evaluated.


2. Are you using a workaround?
See above examples of workarounds lead to some very complex relations that are hard to read or write.

3. What is the use case for your organization?
Easier to read and write clear ELSEIF statements. The current workarounds above can get VERY hard to read.

4. What impact does this problem currently have on your organization?
Extra time reading / writing relations. Lack of clear design intent when reading or writing relations with current workarounds.

1 reply

Community Manager
Jun 12, 2025 12:51 PM UTC
Status changed to: Acknowledged

Thank you @lhoogeveen for your idea. Based on the information you provided, we are acknowledging it as the Community management team. This is not a commitment from the Product team. Other users may comment and vote your idea up.