Get file from Vault?

Get file from Vault?

mrattray
Advisor Advisor
4,764 Views
6 Replies
Message 1 of 7

Get file from Vault?

mrattray
Advisor
Advisor

I'm trying to move some of my iLogic configurator programs over to a Vaulted structure. So far I've only hit one hick-up: Once the file is fully configured, I have a rule that "takes" the user to an IDW file using ThisDoc.Launch(). If this file doesn't exist in the user's local workspace it throws an exception (no surprise). Does anyone know if there is a method to get the file form Vault? There's no check in/check out involved, the files will be checked out to a "library user" that will not be running the programs.

 

This is what I envision (faked):

 

Try
      ThisDoc.Launch("My Drawing File.idw")
Catch
      Try
            ThisApplication.VaultAddIn.MagicVaultMethod("$/Folder/Folder/My Drawing File.idw")
            ThisDoc.Launch("My Drawing File.idw")
      Catch
            MsgBox("Unable to retrive file from Vault")
      End Try
End Try

 

Mike (not Matt) Rattray

0 Likes
Accepted solutions (1)
4,765 Views
6 Replies
Replies (6)
Message 2 of 7

rjay75
Collaborator
Collaborator

Unfortunately there's no magic vault command to do that. The vault api would have to be used to get the file from the vault. 

Message 3 of 7

mrattray
Advisor
Advisor
Sorry for the delayed response, I had some hot jobs crop up.
I didn't think there would be a magic command, but how deep of a rabbit hole are we talking about here? I'm comfortable in iLogic and in the Inventor API, but I don't have any experience outside of that. I have a lot (few dozen) of these programs that use this workflow, so if it's remotely reasonable to be able to automate this I think it would be worth a try.
While I was milling this over in the back of my head I thought of another issue. This likely stems from my inexperience with Vault, but is there a way I can enforce the use of the latest versions of my configurators? I believe there's a "refresh from Vault" command in the GUI that does this, so I would be simply looking to automate this procedure.
Mike (not Matt) Rattray

0 Likes
Message 4 of 7

rjay75
Collaborator
Collaborator
Accepted solution

It's pretty deep down the rabbit hole. Here in super high level pseudo code would be what is needed to refresh(get latest version of)  a specific file from the vault.

 

VltService = SetupVaultService(server)
VltService.LogIn(vault, user, pass) or LogInWindows(vault)
DocService = VltService.GetDocService()
FileInfo = DocService.GetFileInfo("$/root/project/folder/abcd.ipt")
DocService.Download(FileInfo.LatestVersionId, "c:\Temp\abcd.ipt")

 That's the basic steps involved. Each of those steps require several lines of code and is more involved than it looks. For instance see this blog post to download files from the vault. How to acquire files.

 

That capability then has to be made accessible from iLogic then. Because I need similar functionality from iLogic I've actually been working on a library for iLogic to do this. Just have to get time to finish it.

 

It's possible but communicating with the vault is anything but straight forward.

0 Likes
Message 5 of 7

mrattray
Advisor
Advisor
Thanks, Ray!
That actually doesn't look too painful on the surface (the code in the blog post). I think this is something I'll want to pursue. I'll pick at it in my spare time and eventually I'll come up with something. If I do I'll be sure to post back here with it, would you mind doing the same if you reach a usable level of progress?
Since doing it entirely in iLogic may be a bit much (for me), I think I'll play around with using some sort of stand-alone application that I'll fire from iLogic.
Thanks again!
Mike (not Matt) Rattray

Message 6 of 7

Anonymous
Not applicable

@mrattray

Mike, did you get round to doing this either in iLogic or with an .exe?

I have a similar issue where I'm placing components with the IV API, but if the user doesn't have the component locally then I want to download the latest version from Vault.

0 Likes
Message 7 of 7

bhavik4244
Collaborator
Collaborator

@mrattray @rjay75 @Anonymous 

 

I have a kind of similar need:)

 

I have an assembly which consumes lots of components, some of them are library and some are standard fabrications items assembled in it. I would be grateful to you if I can have any solution which automatically grabs the missing files from Vault. So users don't have to grab the whole vault stuff to the local machine.

 

Looking forward to the solution.

 


Bhavik Suthar
0 Likes