This button transfers the variable displayed under Name into the input field.
An algorithm constructed through an IF condition can look as follows:
IF ( ) THEN D3 = ELSE D3 = ENDIF
Enter your condition (e.g. "L1.EQ.10") between the brackets ().
Behind THEN D3 =, enter the value which D3 has to accept if the condition is met.
Behind ELSE D3 =, enter the value which D3 has to accept if the condition is not met. End the condition with ENDIF.
IF (L1.EQ.10) THEN D3 = 20 ELSE D3 = 30 ENDIF
If distinction of cases shall be made, use ELSEIF statements.
IF (L1.EQ.10) THEN D3 = 10 ELSEIF (L1.EQ.20) THEN D3 = 20 ELSEIF (L1.EQ.30) THEN D3 = 30 ELSE D3 = 40 ENDIF
Several IF conditions set one after another within one Attribute algorithm variable.
If you wanted to solve the same with one single IF condition with ELSEIF cases, this would require much more ELSEIFs.
Structure of conditions with the help of an example:
The first IF condition has to contain an ELSE alternative, in order for the variable to be initialized. All other IF conditions may contain ELSE alternatives optionally.
IF (OPZ1.EQ.'-' )THEN LINAALG = '$IDNR./$CX1./$VL./$MOTX./$OM1./$COEL./$DA./$AP1./$AA1.' ELSE LINAALG = '$IDNR./$CX1./$VL./$MOTX./$OM1./$COEL./$DA./$AP1./$AA1./$OPZ1.' ENDIF IF (OPZ2.EQ.'-' )THEN LINAALG = '$LINAALG./' ELSE LINAALG = '$LINAALG./$OPZ2.' ENDIF...
IF (OPZ1.NE.'-' )THEN LINAALG = '$IDNR./$CX1./$VL./$MOTX./$OM1./$COEL./$DA./$AP1./$AA1./$OPZ1.' ENDIF IF (OPZ2.NE.'-' )THEN LINAALG = '$LINAALG./$OPZ2.' ENDIF...
Also correct: If there is a simple statement at the first position, an "ELSE" can be omitted at all, since the statement will always initialize the variable.
CNSTYPECODE = '$MODEL.$W.-$ST.-$THETA.-$TYPE.-$SPRING.' IF(K.EQ.1)THEN CNSTYPECODE = '$CNSTYPECODE.-K' ENDIF IF(FK.EQ.1)THEN CNSTYPECODE = '$CNSTYPECODE.-FK' ENDIF IF(N.EQ.1)THEN CNSTYPECODE = '$CNSTYPECODE.-N' ENDIF
The first condition, which is always calculated, has to prevent an endless loop. Following "if...endif" always call the first condition and attach an additional value.
So in the first condition do not use the variable of assignment for the ELSE case.
IF (OPZ1.EQ.'-' )THEN LINAALG = '$IDNR./$CX1./$VL./$MOTX./$OM1./$COEL./$DA./$AP1./$AA1.' ELSE LINAALG = '$IDNR./$CX1./$VL./$MOTX./$OM1./$COEL./$DA./$AP1./$AA1./$OPZ1.' ENDIF IF (OPZ2.EQ.'-' )THEN LINAALG = '$LINAALG./' ELSE LINAALG = '$LINAALG./$OPZ2.' ENDIF...
Incorrect: (difference in red)
IF (OPZ1.EQ.'-' )THEN LINAALG = '$IDNR./$CX1./$VL./$MOTX./$OM1./$COEL./$DA./$AP1./$AA1.' ELSE LINAALG = '$LINAALG./$OPZ1.' ENDIF IF (OPZ2.EQ.'-' )THEN LINAALG = '$LINAALG./' ELSE LINAALG = '$LINAALG./$OPZ2.' ENDIF...


![[Note]](https://webapi.partcommunity.com/service/help/latest/pages/it/installation_ecatalogsolutions/doc/images/note.png)

