05-23-2006 07:58 AM - edited 05-23-2006 07:58 AM
Message Edited by StGl on 05-23-2006 07:58 AM
05-24-2006 05:19 PM
Hi Stefan,
If you mean that the user has selected a file in the NAVIGATOR tree view, which looks just like Windows Explorer, then I don't know of a way to help you. If you meant a searched file record in the ReturnList table in DIAdem 10, or a selected File, Group, or Channel in the Data Portal, then I could help.
How about a nice file dialog for your VBScript? Or if you want to get really fancy, you could try adding an ActiveX container control to a new SUDialog and trying to fill it with Windows Explorer or Internet Explorer. I know Internet Explorer behaves fairly nicely in that scenario, but I've never tried Windows Explorer-- I assume there's an ActiveX object for that too.
Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-26-2006 03:50 AM
05-26-2006 10:15 AM
Hi Stefan,
I don't know if you are familiar with the customizable context menu in the ResultsList table in DIAdem 10, when you have run a search and are right-clicking on the results of the search. Anyway, you have the option of inserting your own custom menu items into the context menu that shows up then. We're looking into the possibility of doing something like that for the regular tree view control in the NAVIGATOR. No guarantees as to when that might show up, but it would make a lot of feature sense, and I'll bet it would give you what you want.
The idea of having a global variable populated with the currently selected file paths is also a cool one. I'll pass that along to R&D.
Cheers,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-26-2006 10:24 AM
Hi Stefan,
The joke's on me. I was halfway through my email to R&D when it suddenly hit me that in DIAdem 10 this functionality is already there! The new NAVIGATOR object variable gives you access to the selected items in the regular NAVIGATOR tree. Here's the code that already works in DIAdem 10!
Set Elements = Navigator.Display.CurrDataProvider.Browser.SelectedElements
FOR i = 1 TO Elements.Count
IF Elements(i).IsKindOf(eSearchFile) THEN
Msg = Msg & i & vbTAB & Elements(i).Properties("fullpath").Value & vbCRLF
END IF
NEXT
MsgBox Msg
Sorry it took me so long to think of this (and don't tell R&D!),
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-28-2006 01:35 PM
05-29-2006 05:08 AM
05-29-2006 05:29 AM
Hi Stefan
Here is a smal modification of Brads script, that works even outside of the search index:
Set Elements = Navigator.Display.CurrDataProvider.Browser.SelectedElements
FOR i = 1 TO Elements.Count
IF Not Elements(i).IsKindOf(eSearchchannelgroup) And Not Elements(i).IsKindOf(eSearchchannel) THEN
Msg = Msg & i & vbTAB & Elements(i).Properties("fullpath").Value & vbCRLF
END IF
NEXT
MsgBox Msg
Winfried
05-29-2006 06:13 AM
Thanks Winfried,
it's working. Still much to learn for me...
Regards
Stefan