Configuration Files for Nodes

The various Python script interfaces can optionally be configured using a JSON file with the same file name and same directory as the Python script *.py but with the extension *.json.

The following name-value pairs can be contained in the file:

NameValue Description
Name Specifies a distinct display name.
Maturity Specifies the level of development. Allowed values are Beta, Stable and Deprecated.
ScriptInterfaceVersion Specifies the version of the script interface. In the current optiSLang version, interface version 3 is the recommended choice for all node types.
EnableParallel Allows parallel execution of multiple instances of the integration. Allowed values are true and false.
EnableMultiDesignMode Enables multiple designs being passed to script at once. Allowed values are true and false.
PythonPath List of search directories. Separate different paths using ; on Windows or : on Linux.
PythonEnvironment

Specifies the type of Python environment to use. The default value is optiSLang Python.

You can chose between different Python environments installed on the system, for example, Python 3.5. 64 bit or Anaconda 3.5 64 bit.

Additional Python environments can be made available by adding the location to the PATH environment variable or to the optiSLang.ini file.

optiSLang's own Python can be extended with additional packages.

AbortMode

Controls how Stop requests to custom integrations are handled.

The default value is KillProcessTree, which terminates the process hosting the custom integration (as well as all processes it started). The other mode is Exception, which injects an exception into the running Python code.

The plugin node has the ExceptionTimeout number of seconds to cleanly finish its processing before terminating processes.

ExceptionTimeout

Used with AbortMode.

Specifies the number of seconds (default of 30) for the plugin node to cleanly finish its processing before the process hosting the plugin node, and sub-processes, are terminated.

InputSlotsDeclares multiple slots by providing {“name_1” : “slot_type_1”, “name_2” : “slot_type_2, …}.
OutputSlotsDeclares multiple slots by providing {“name_1” : “slot_type_1”, “name_2” : “slot_type_2, …}.
SupportsHPCLicenseContext
EnableMaximumRuntime
FileBasedSpecifies whether the plugin node requires a reference file for setup and execution or not. The node edit dialog box will not display a reference file selector when nodes do not require files. Defaults to true for integrations and false for other types of plugin nodes.
FileFilterSpecifies what kind of files are shown when browsing for a reference file in the file selector of the plugin node edit dialog box.
ToolBoxPathSpecifies the location in the Modules pane where the plugin node should appear.
DocumentationSpecifies a link/anchor to documentation for this plugin node. Can be either an Ansys Product Help ID or a path to an HTML file. The path must be specified either absolute or relative to the plugin node.
EnableSolverWizardEnables the automatic support of Python-based integration nodes in the solver wizard. Defaults to false.
IconSpecifies the path to an icon which is used for the plugin node in Modules and Schematic.
EnableReadModeEnables read mode for Node Plugins, Integration Node Plugins, and MOP Node Plugins.
Integration-specific
ShowInputsDisplays the input parameter registration in the plugin integration node edit dialog box. Defaults to true.
ShowOutputsDisplays the output parameter registration in the plugin integration node edit dialog box. Defaults to true.
UseSettings

Displays the node settings in the plugin integration node edit dialog box.

Defaults:

  • Interface version 3: true.

  • Interface version 1 and 2: true if configuration setting is provided. If not, node settings are shown if the interface function for default settings is provided.

An example configuration might look like this:

{    
    "CustomInputSlots": {
        "in_slot_str": "String",
        "in_slot_int": "Integer",
        "in_slot_unsigned": "Unsigned Integer",
        "in_slot_float": "Real"
    },
    "CustomOutputSlots": {
        "out_slot_str": "String",
        "out_slot_int": "Integer",
        "out_slot_unsigned": "Unsigned Integer",
        "out_slot_float": "Real"
    },
    "EnableParallel": true,
    "EnableReadMode": true,
    "AbortMode": "Exception",
    "ExceptionTimeout": 15,
    "SupportsHPCLicenseContext": true,
    "EnableMaximumRuntime": true
}