02-10-2016 06:55 PM
In a lvproj I can right click on a VI and rename it. This has the advantage of updating any referencing VIs (linking still works). I have not found a way to do this programatically.
I can get a list of owned VIs for a vilib, and I can Move, copy and delete those using hte usualyt file tools. But these leave the referencing high and dry.
Is there a way to rename VIs within a VI library?
02-10-2016 07:30 PM
Is this a VI you created, or did it come with LabVIEW? If it is the latter, I wouldn't touch it.
02-11-2016 12:22 AM
I'm a bit confused, not sure I understand your last question.
Anyway, if you want to programatically rename VIs in a project, yes it is possible and actually not very complicated.
Basically you need 3 steps :
While the project is opened get the project reference :
Then find the item (VI or other type of item) by name to get its project item reference :
Then rename it :
Hope this helps
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-11-2016 07:44 AM
You d realize that vi.lib is listed as a dependency and is not part of your project, right? Again, I'd be very careful mucking around inside that folder.
02-11-2016 08:45 AM - edited 02-11-2016 08:46 AM
Point is that vi.lib is "property" of the LV installation. Modifying the LV installation (e.g. installing a toolkit) can "reset" all changes you have done yourself in that folder.
Norbert
EDIT: If you mistake vi.lib for lvlib, then above mentioned points are still true, but most likely will not apply to your question.
02-12-2016 11:25 AM
I can't seem to get this to work with 2013.
I want to do the following:
1) Copy a project to a new location (DONE)
2) Rename a class within this project to a new name. (I get invalid VI reference when I try your method)
3) Rename the library that contains this class. (Have not tried this yet)
Thanks!
PS. I think the other people are confused but I don't think the person was asking about changing vi.lib just vi libraries or lvlibs. I think they saw a period where there wasn't one.
02-12-2016 01:59 PM
Thanks TiTou: I did manage this same solution. The trouble I was having was that I renamed a .ctl file, and then the other VIs did not see it anymore. My solution was to use scripting to replace that control in the calling VIs. Renaming within hte project (non-programatically), did not cause this same problem. Or at least I don't think it did.
(OS, I mean lvlib in theoriginal desciption of my problem. I see this confused several people.)