NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add directory to the search directory in runtime at .net

hello
im using test stand engin in c# .net and i would like to change the search directory dynamiclly through the c# code.
thanks
yaniv
0 Kudos
Message 1 of 5
(4,323 Views)
Hello Yaniv,

you can use "Engine.SearchDirectories" to get a reference to the SearchDirectories object, and call "Insert" to add a new, user-defined search directory, "MoveSearchDirectory" to move a search directory, "Remove" methode to remove a search directory Or you can get a certain SearchDirectory Item to specify its Path property.

The C# Code may look like:

    IEngine engine = this.axApplicationMgr.GetEngine();
    SearchDirectories searchDirectories = engine.SearchDirectories;
    SearchDirectory searchDirectory = searchDirectories[item index];
    searchDirectories.Insert(......);
    searchDirectory.Path = ......;

May that can help you.
Regards
MY
Message 2 of 5
(4,313 Views)
Hi My,
 
Thats a great hint (5)!
Now i can reconfigure my SearchDirectories by a programm.
Just an additional Question:
Have you already found the api-function for unloading modules ?
 
Greetings
 
Juergen
--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 3 of 5
(4,296 Views)
Hello Juergen,

you are welcome!

I am not quite sure which UnloadModule you mean, so i will give you all UnloadModule functions in TestStand API. You can find more information in NI TestStand Help.

Engine.UnloadAllModules
: unloads all code modules associated with steps, step types, and substeps.
SequenceFile.UnloadModules :  unloads the code modules from all steps in all sequences of the sequence file.
Sequence.UnloadModules : unloads code modules for all steps in the sequence.
Step.UnloadModule : unloads the code module for the step.
Regards
MY
0 Kudos
Message 4 of 5
(4,289 Views)

Hi @My NI,

 

I had a similar question here...

 

https://forums.ni.com/t5/NI-TestStand/NET-API-for-SearchDirectories-cfg/m-p/4068402?profile.language...

 

Your example is used by the engine with the specific search directory configured.  Is there a way to point to a specific path to other search directories to interact with?  For example, it would be nice to read multiple search directory files to verify they are all consistent.  Thx.

0 Kudos
Message 5 of 5
(1,546 Views)