Control User Input

Variables can be used to collect input which is required for the script to operate.

For example, a script which is creating a mesh of any geometry would require a geometry file and Element Size.

The script has the data names defined as CADFile and elem_2D. These will take the values from Pulse variables InFile (Study) and elem_size (Task).

#File name for import obtained from Pulse
CADFile=pulse.getVariableValue('InFile')

#Mesh variable obtained from Pulse Variable.
elem_2D=pulse.getVariableValue('elem_size','Task')
The Author controls how the input should be requested through the GUI description. What widget to use depends on the nature of the variable itself. A file variable goes hand in hand with a File Path Open widget which you can use to select explore and select a file.


Figure 1.
All GUI widgets of variables assigned to a task will be organized in a dialog. This dialog will be generated at run time. At the execution of the task, you will be prompted to input the requested information. It can also be previewed from the Edit Task dialog. In the Input GUI tab, you can add structure to and organize the variables in the dialog.


Figure 2.

Input GUI

In many scenarios a task or process requires multiple inputs. If this is the case, it is highly recommended for an author to organize and add structure to the dialog to make it clear and intuitive for an Analyst. This is achieved through the Input GUI tab in the Edit Task dialog.

By default, all variables which originate from user input will be added to a Property Editor Layout in a flat list. Use RMB Context menu to organize your structure. It’s possible to combine variables into categories and layouts into tabs following this hierarchy.


Figure 3. Default Structure of User Input Dialog


Figure 4. Organized Structure of User Input Dialog

Control Visibility of Layouts - Active Condition

If the Active in Dialog option is disabled for a layout or tab, they will not be visible in the Input dialog. The visibility can also be controlled automatically through the Active Condition option. If the condition is not fulfilled the layout or tab will not be visible. This action can be used to create dynamic dialogs.

In the example below, the variable Action determines what will be shown in the dialog. As Active Condition is fulfilled for Layout_5 (Action = Create), it will be visible. However, as the active conditions for the other layouts are not fulfilled, these are not visible. If an Analyst would select Delete for Action, the dialog will update and show all variables belonging to Layout_4 instead.


Figure 5.

Edit Input

Through the Edit Input option on the RMB context menu of the task you can set the values of all inputs before process execution.

If all inputs of a task are defined, then no input prompting will show up at execution.

Figure 6.