Program > Editing a Design > IF-ELSE Statements > About Design Branches
  
About Design Branches
Conditional statements can be used to create a design branch, enabling you to control whether a feature or component is included in the design.
For example, if the original Part design was:
ADD PROTRUSION.....
ADD HOLE.....
ADD CUT.....
The modified design might look like this:
ADD PROTRUSION.....
IF d1 > d2
ADD HOLE
...
END ADD
ENDIF
ADD CUT.....
END ADD
Conditional statements are also valid for assemblies. They control whether a particular part or subassembly is added to the assembly or executed. In the following example, PART_B is not used unless the parameter DIA has a value less than or equal to 1.25.
ADD PART BASE_1
....
IF DIA > 1.25
ADD PART PART_A
.....
END ADD
ELSE
ADD PART PART_B
.....
END ADD
ENDIF
Creo Parametric reevaluates any Pro/PROGRAM feature conditional statements (for example, IF statements) before regenerating each feature. As a result, only a single Regenerate command is needed for a design in which Pro/PROGRAM feature conditional statements are changed by Evaluate features and reference dimensions.
However, if you add to a design a Pro/PROGRAM feature conditional statement that is changed by a later feature, the system provides an error message that the design is now inconsistent.