DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic dialog box to select group

Hello there,

 

I have a script which runs on a group in the data portal.  To use it the user has to set the line "usingGroup = 1" to be the value they want.

What would be better would be if when the script starts it pops up a dialog box which contains a combox control enumerated with the list of groups in the data portal. The user would just select the one they want and click okay.

I've been looking at the examples but I just don't get how to do this.  Does anybody have an example they could point me to plesae?

Thank you,

Martin

0 Kudos
Message 1 of 7
(5,359 Views)

Hello MartinMcD,

 

Please try the attached example.

 

Greetings

Walter

0 Kudos
Message 2 of 7
(5,349 Views)

Hi MartinMcD

 

Use this small Script and the attached dialog.

Dim oGroup
Call SUDDlgShow("Main","GroupSelect",oGroup)
Call MsgBox(oGroup.Name)

 The dialog shows a List of all group names and returns the selected group object

 

Winfried

0 Kudos
Message 3 of 7
(5,347 Views)

Wonderful, thank you both very much for such speedy help.

Martin

0 Kudos
Message 4 of 7
(5,341 Views)

Hello,

 

I too would need to select different groups through some box, I found this thread which exactly deals with my problem. However I'm not used to SUD files at all, and when I try Winfried's solution, I get some error message : Cannot find ".........." file (I checked, the file is there)

 

Does this have something to do with the fact that I only have DIAdem 2011 ?

Thanks

0 Kudos
Message 5 of 7
(5,179 Views)

Hi Near,

 

I just tried this in DIAdem 2011, and you're right that it doesn't work, but not because of DIAdem 2011.  The Dialog initialization callback was broken in the dialog-- I removed it, and now everything works.  Note that you should always pass the full path to the dialog in the SudDlgShow() command, and the easiest way to do that is with the AutoActPath or CurrentScriptPath variables.  But that only works if you save the below script to a *.vbs file in the same folder as the SudDialog.

 

Dim oGroup
Call SudDlgShow("Main", AutoActPath & "GroupSelect",oGroup)
Call MsgBox(oGroup.Name)

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 6 of 7
(5,149 Views)

Thanks Brad, that is much clearer now! (Many answers recently... vacations over? Smiley Tongue)

Everything works perfectly now.

0 Kudos
Message 7 of 7
(5,141 Views)