02-26-2019 02:39 AM
Hello Community,
I have a project which uses auto populating folders and I need to rename some of them. There are LOTS of VIs under the folders so pressing F2 on each individual VIs would be really error prone and time consuming.
If I simply rename the folder on the harddrive then the project will get broken and there will be hundreds of conflicts which I need to address individually. This is also seems a troublesome way to do it.
Its any sort of an easy way to rename a folder? (There is THIS idea which has only implemented for NXG... I'm looking for something like this). I have tried scripting the Project Explorer by using Invoke and Property nodes, but could't find anything allowing me to programatically rename VIs in the project structure. (of course I have found the nodes allowing me to save the VIs to a different place ("Save.Instrument" node) but it does not update the project dependencies, so its not a solution.)
Let me know if you have any ideas. Thanks.
(Normally I dont use virtual folders, but in this case using auto populating folders is a customer requirement I cant deviate from.)
Solved! Go to Solution.
02-26-2019 02:50 AM
Move a single vi from each folder to the new one with F2. Select Files view (click the tab or press Ctrl+E), then drag and drop all remaining vi's to the new folder. I seldom use auto populating folders so there may be a quicker way though.
02-26-2019 03:17 AM
This should work, but i'm not 100% sure, so always backup. 🙂
Close LV
Rename the folder on disk
Open project in a text editor, it's an XML file
Change paths to fit
Open LV
/Y
02-26-2019 03:33 AM
No, it has nothing to do with that.
02-26-2019 03:50 AM
@1984 ha scritto:
No, it has nothing to do with that.
What has nothing to do with what?
02-26-2019 03:56 AM
Sorry mate, it was a response for the 2nd reply. Yours seems working fine. I did not try moving the files in the "files" view of the project explorer, so I have not found that earlier. Thx.
02-26-2019 03:56 AM
In the project, select CTRL+E (Show in Files view). That will show the files view of the project. Or click on the File tab of the project explorer. Then select the VIs or folders to move, and right click the selection, and select move on disk. Browse to the new location (optionally make the now location from the browse dialog with new folder), and LV will move the files and folders, and often it will relink everything properly.
There are limits. After a successful move, I'd close and reload the project. Especially moving in combination with renaming classes seems to confuse LV after a while.
02-26-2019 08:11 AM
@1984 wrote:
Hello Community,
...
(Normally I dont use virtual folders, but in this case using auto populating folders is a customer requirement I cant deviate from.)
I am very familiar with adapting my coding approach to a style that make my customers comfortable but I hope you did advise that auto-populating folders is a bad requirement.
At the very lest it greatly slows down LV as it constantly is scanning for changes to the folders.
Ben
02-26-2019 09:42 AM
@Ben wrote:
@1984 wrote:
Hello Community,
...
(Normally I dont use virtual folders, but in this case using auto populating folders is a customer requirement I cant deviate from.)
I am very familiar with adapting my coding approach to a style that make my customers comfortable but I hope you did advise that auto-populating folders is a bad requirement.
At the very lest it greatly slows down LV as it constantly is scanning for changes to the folders.
Ben
I never do anything else then auto-populating, and I really don't like the virtual folder approach... I find managing one hierarchy hard enough. Managing two (the one on disk and the one in the project) is just too hard for me.
I never noticed any slow down, but then again I might be used to it.
02-26-2019 10:21 AM
wiebe@CARYA wrote:
...I never noticed any slow down, but then again I might be used to it.
Trying to help a fellow wire-worker...
When the project tops 100- VIs, you will notice.
I actually go a step beyond the virtual folders and use virtual folders inside of Libraries (see here for a blog I wrote about libraries). I have found that a developer only has to clone a library once to fall in love with Libraries (and the virtual folders used to define the scope).
Try it, you will like it!
Ben