inventor log into vault add-in

inventor log into vault add-in

Anonymous
Not applicable
1,183 Views
2 Replies
Message 1 of 3

inventor log into vault add-in

Anonymous
Not applicable

Hi all,

 

i run 3 vaults for different section of my work and i was wondering if there is an easy way to switch between vaults and .ipj files 

 

so i have built a program that 

1, ask the user witch vault they would like to work in  

2, open inventor

3, change the .ipj file to the correct one 

 

the next bit is i need to somehow log into the correct vault via the inventor add-in for vault.

i can't find any API around this can anyone help?

 

N.B. to log in i use windows account log in. 

 

Thank you.

 

0 Likes
Accepted solutions (1)
1,184 Views
2 Replies
Replies (2)
Message 2 of 3

jjstr8
Collaborator
Collaborator

I don't there's an API route (or easy one at that).  The information is stored in %AppData%\Autodesk\Inventor 2017 Vault Addin\ApplicationPreferences.xml (my version is 2017, so substitute with your version).  You'll have to parse the XML file and change ServerName (if needed), DataBaseName, and maybe set AutoLogin to True.  Your users will have had to log into Vault already, since encrypted credentials are stored in the XML file for a Windows login.

 

Also, I would have your external program launch Inventor with the ipj file, so it will load automatically.  This doesn't work if the Startup option is set to New from Template.  You can grab the ipj open command from the registry at HKEY_CLASSES_ROOT\Inventor.ProjectDocument\Shell\Open\Command.  Just substitute the %1 with your full ipj path and filename.  All it is is the /pf command line switch for inventor.exe

0 Likes
Message 3 of 3

JelteDeJong
Mentor
Mentor
Accepted solution

you can change a project file with the code:

 

Dim inventor As Inventor.Application = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application")
inventor.Documents.CloseAll()
Dim projectFile As DesignProject = inventor.DesignProjectManager.DesignProjects.AddExisting("full/path/to/your/project/file")
projectFile.Activate()

As far a i know there is none api for changing the vault server. Maby the way @Anonymous descriped is good for you. But if you want a less complicated way then you could force inventor to logout and login with this code:

 

 

ThisApplication.CommandManager.ControlDefinitions.Item("VaultLogout").Execute()
ThisApplication.CommandManager.ControlDefinitions.Item("VaultLogin").Execute()

if you go this path the user still needs to set the correct vault by hand. The advantage is that you could do all this from a iLogic rule. That rule could look something like:

 

 

ThisApplication.CommandManager.ControlDefinitions.Item("VaultLogout").Execute()
ThisApplication.Documents.CloseAll()
Dim projectFile As DesignProject = ThisApplication.DesignProjectManager.DesignProjects.AddExisting("full/path/to/your/project/file")
projectFile.Activate()
ThisApplication.CommandManager.ControlDefinitions.Item("VaultLogin").Execute()

 

 

 

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes