If Example

Process IF programming conditional statement.

Pulse can now process conditional statements and decide the next steps. An if statement is a programming conditional statement and if proved true, it performs a function or displays information.

The following applications are used in this tutorial. Use the Application names as follows for a seamless experience:
Application Path Arguments
SimLab C:/Program Files/Altair/2021.2/SimLab2021/SimLab.bat  
Python C:/Program Files/Altair/2021.2/common/python/python3.5/win64/python.exe $SCRIPTNAME
Note: The argument for Python is mandatory.
  1. From the Library Browser, If Example folder, select the If Example file and drag it into the Block Diagram.
  2. Click Run.
  3. In the User Process Variables dialog, enter the value for Critical Mass (M0) and click OK.


    Figure 1.
  4. Select the ModelDemo.CATPart file for the CAT Part File in the Entity Editor and click Close.


    Figure 2.
    Note: The CAT Part File is available at C:\Users\user\Documents\ScriptDir\resources.
    The selected CAT Part File opens in the SimLab application, where the model meshes and the mass are calculated.
  5. Exit SimLab.
    Based on the value entered in the Critical Mass, True or False branch activates, and the corresponding dialogs display.


    Figure 3.