Passing Parameters to an User Dialog Box From a Python Script in DIAdem

Updated Mar 13, 2024

Reported In

Software

  • DIAdem

Issue Details

  • Can I pass parameters from a DIAdem Python script to an User Dialog Box?
  • Are there limitations when using user dialog box files (.sud extension) in a DIAdem Python Script?

Solution

DIAdem global variables can be used to exchange data between the Python Script and the Scriptable User Dialog (SUD) box, this is shown in the following example code: Use a SUD Dialog to Provide a Text String to a DIAdem Python Script. When calling the DIAdem global variable within the Python script, make sure to define it as dd.variableName.

Regarding limitations, DIAdem does not support Python in SUDs. Therefore, you cannot pass a Python-specific object, such as a Python class, to a SUD. However, you can take parameters of the class, such as strings or numeric values, and pass that into the SUD.

Additional Information

The SUDs are only automated with Visual Basic Script (VBS), each action (button press) causes a VBS callback subroutine to run, as per the SUD definition, so you can't have a VBS code interacting with a Python-specific object variable. For more information related to Python Scripts in DIAdem you can refer to: General Information on Python Scripts.