From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Snapshot Folder Library Scripting

Solved!
Go to solution

So I I have a library (.lvlib) and I have several folders with several files in them, and those folders some times have folders with files in them.  Using the Add >> Folder (Snapshot) function I can add all my files and folders in one click (more or less).

 

Unfortunatly I can't seem to find that function using Invoke/Propety nodes.  How can I add a snapshot folder to a library programtically?

 

At the moment I am working on writing my own routine that will go through all files, and all folders and add them using the Add File invoke node, but this is tedious, slow, and error prone.

 

BTW libraries don't support auto-populate so that won't work either.

0 Kudos
Message 1 of 4
(2,448 Views)
Solution
Accepted by topic author Hooovahh

I don't know if this is the best way, but you can call the AddItem method (with type folder) on the library, then call Convert to auto-pop and stop auto-pop on the new item (just calling the first method seems to ignore the path input).


___________________
Try to take over the world!
Message 2 of 4
(2,418 Views)
As mentioned in my post libraries dont support auto-populate so i dont think that will work. But admitidly i havent tried it.
0 Kudos
Message 3 of 4
(2,407 Views)

@Hooovahh wrote:
But admitidly i havent tried it.

I have. I can't comment on auto-pop. folders, since I never use them, but the code I described does work. You could also skip the last step and keep the auto-pop. folder, but I have no idea how LV will behave in such a situation. It might be perfectly fine. It might cause problems.


___________________
Try to take over the world!
Message 4 of 4
(2,401 Views)