Parameters

The following instructions helps the user to create parameters in the python script.

  • Parameters must be defined in the imported script.

  • Parameters and values are optional.

  • ParameterNames and ParameterValues must be delimited with symbols.

    The format must be: “#AutomationBuilder_Parameter {“ParameterName”} {= “ParameterValue”}.

  • {ParameterName} is the name given to the parameter. This allows the values to be referenced in the python script.

  • {ParameterValue} is the default value given to the parameter. This value can be modified in the editor.

The example below shows the format of the ParameterName and ParameterValue in the script.

  • #AutomationBuilder_Parameter “numWidgets”: this will create a new parameter called numWidgets.
  • #AutomationBuilder_Parameter “numWidgets” = “4”: this will create a new parameter called numWidgets and initialize to the value 4.

Using parameters within the python script

  • Parameters can be used in the script by creating an instance of the parameter helper.

    parameterHelper = AutomationBuilder_Parameters.create()

  • Individual parameters are retrieved by calling GetParameter(parameterName).

    devicename = parameterHelper.GetParameter(“Name”)