Jump to content
etgohomeok

Is it possible to programmatically call "Move on Disk..." function that is available in the Project Explorer?

Recommended Posts

Hello, this is not strictly VI Scripting related but I believe it's a pretty similar topic, so I hope this fits in with the discussion on this board.

I am attempting to write a script that parses through the contents of a very large LabVIEW project (thousands of files) recursively and selectively moves/renames some of the files. The basics of this are fairly simple, however I have thus far been unable to come up with a way of moving files on disk that handles all relinking and dependencies without any issues.

At a high-level, my question is whether or not the "Move on Disk..." option in the right-click menu of the project explorer "Files" view is accessible programmatically somehow, using invoke nodes. The option I'm talking about, for clarification, is this one:

asdf.png

Using this option in the project explorer seems to be able to move all types of files in the project (VIs, libraries, classes, etc.) and handle all relinking properly without any conflicts popping up. However, there doesn't seem to be an equivalent "Move on Disk" method int he invoke node for project items. I have had some success with some of the "super secret" nodes for VIs:

asdf.png

However this only works for VIs and there is no equivalent function for library (.lvlib) and class (.lvclass) files. I've tried various combinations of saving and relinking functions that are available, however I always end up with conflicts when I load the project after running my script.

If the "Move on Disk..." function is not accessible programmatically, does anyone know of another way to programmatically move/rename library and class files on disk without causing conflicts?

Thanks,

Ethan

Share this post


Link to post
Share on other sites

If you've installed NI-GDS or OpenGDS, you can see how I did the Rename Class function:
LabVIEW 20XXresource\Framework\Providers\Open_GDS\ClassProviders\Provider_LvNativeClass\ClassWriterNative_class\RenameClass.vi

http://opengds.github.io/

But basically you have to do this:
1) Open the library/class
2) Get All Descendents (and get the Path for all items, if ite you find is a class or libraray, you need to iterate through those as well)
3) Save found items to new location.
4) Save all items again

 

 

Share this post


Link to post
Share on other sites

I believe there is a helper as well in Darren's Hidden Gems package in VIPM, and an example of the usage in the actor framework sample project scripting library.

Share this post


Link to post
Share on other sites

Thanks, I was not aware of the hidden gems package and it looks like there is a function there for moving libraries on disk. Looking at the block diagram of that VI, it seems that there is a specific order of operations in saving the various project items to ensure the linking stays in tact. We will work with that and see if we can get our project to work.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.