DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Run Python Script | User Dialog Python

Solved!
Go to solution

Hi everybody, 

 

I've got two questions about using Python as the Script language in DIAdem (2021). 

 

1. It works to execute my Python Script via the "Script" panel (open script, start script). But I'd like to execute my Python Script using the "Run Script" button or <Ctrl-F5> shortcut, so how can I make this happen? If I try to run my Script this way, nothing happens. 

 

2. Is there any way to use Python as the Script language to create user dialogs? 

 

Thank you!

 

0 Kudos
Message 1 of 2
(2,708 Views)
Solution
Accepted by topic author variocrew

Hi variocrew,

 

If you open up the "DIAdem Settings" dialog, then look in the "General" section for the "Start script" field, you can type in the full file path of your python *.py file.  Then click "OK" in the "DIAdem Settings" dialog, save the Desktop.DDD file and then close and restart DIAdem.  The python script you configured will now run each time the DIAdem application starts (and uses the Desktop.DDD file).

 

You can also invoke a *.py file from a VBScript by using the traditional ScriptStart() command and passing the full python script file path in the command's argument.

 

Unfortunately, as of DIAdem 2021 there is no way to use python to automate a DIAdem *.SUD custom dialog file.  There you're stuck using VBScript, though again if you need to run python code, the ScriptStart() command might help in that context as well.

 

Brad Turpin

Principal Technical Support Engineer
NI

Message 2 of 2
(2,676 Views)