Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get file from Vault?

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
mrattray
4319 Views, 6 Replies

Get file from Vault?

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

6 REPLIES 6
Message 2 of 7
rjay75
in reply to: mrattray

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
in reply to: rjay75

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

Message 4 of 7
rjay75
in reply to: mrattray

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.

Message 5 of 7
mrattray
in reply to: rjay75

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
in reply to: mrattray

@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.

Message 7 of 7
bhavik4244
in reply to: mrattray

@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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report