Accessing Python Variables From VBS and Vice-Versa in DIAdem

Updated Jul 26, 2022

Environment

Software

  • DIAdem

DIAdem allows users to run Python and VBS scripts. In order to achieve higher productivity, running other scripts from the main script may be necessary. 
This article shows how to access Python script variables from a VBS script.

1. Sharing variables from Python to VBS
 
Simply define the variable as global by running dd.GlobalDim("variableName") and now you have access from VBS you can try Print variableName (of course after assigning some value to the variable in Python beforehand)

2. Sharing variables from VBS to Python
 
Try this in VBS:
If Not Iteminfoget("variable2") Then
  Call GlobalDim("variable2")
End If


 test it by running print(dd.variable2)

Congratulations now you have access to variables in both languages.