Hi @j_weber
I did some digging around and while this is theoretically possible, it would require knowledge/methods that is technically against Vault TOS. You would almost be better off running multiple Inventor instances, each logged into a different vault - possibly setting the Titlebar text to the vault you are logged into using ThisApplication.Caption. Though this would probably be more effort than just switching as you need.
It is possible to simulate pressing the vault login/logout buttons on the ribbon using
ThisApplication.CommandManager.ControlDefinitions.Item("VaultLogout").Execute2(true)
ThisApplication.CommandManager.ControlDefinitions.Item("VaultLogin").Execute2(true)
However, the logout command shows a popup which may be difficult to programmatically close afterwards?, and the login command obviously just shows the gui. Working these commands could possibly lead somewhere, but it can be hard to hook into GUIs when you don't know when they will open.
I did try to switch the vault connection held by Inventor in the back-end using
Dim mVltCon As Autodesk.DataManagement.Client.Framework.Vault.Currency.Connections.Connection
= Connectivity.Application.VaultBase.ConnectionManager.Instance.Connection
and some ADM Library functions to relogin, however it causes a de sync with the vault addin leading to crashing.
There is a way into the vault addin using
Dim edm = Connectivity.InventorAddin.EdmAddin.EdmSecurity.Instance
however, most of its easily accessible methods result in GUIs popping up which defeats the purpose.
A proper solution will only be possible by submitting a request to vault development team to expose the addin's automation object and them creating API functions to login/logout while keeping the vault addin in sync.
Greg