Check if user is connected to the vault

Check if user is connected to the vault

Anonymous
Not applicable
2,382 Views
5 Replies
Message 1 of 6

Check if user is connected to the vault

Anonymous
Not applicable

Hi community!

 

I'm developing a console app that communicates with Inventor 2017 by using the API. I'd like to check if the user is connected to the vault.

I've find that code but the VaultBase namespace does not exist.

 

https://adndevblog.typepad.com/manufacturing/2016/03/inventor-add-in-that-gets-the-status-of-a-file-... 

 

Dim myConnection As VDF.Vault.Currency.Connections.Connection = Nothing
    ' Get the Vault connection from Inventor Vault log in
    myConnection =
        Connectivity.Application.VaultBase.ConnectionManager.Instance.Connection()

    If myConnection Is Nothing Then
        System.Windows.Forms.MessageBox.Show _
                            ("Unable to get Vault connection, logged into Vault?")
        ' Debug.Print("Unable to get Vault connection")
        Return
    End If

I added all references to Autodesk.Connectivity.* and Autodesk.DataManagement.*.

 

Thanks,

Pascal

0 Likes
Accepted solutions (1)
2,383 Views
5 Replies
Replies (5)
Message 2 of 6

bradeneuropeArthur
Mentor
Mentor

You could also take a look at the EDM add in!

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 6

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @Anonymous ,

Would this work for you?

AddReference "Autodesk.DataManagement.Client.Framework.Vault"
AddReference "Connectivity.InventorAddin.EdmAddin"
Imports VDF = Autodesk.DataManagement.Client.Framework
Imports edm = Connectivity.InventorAddin.EdmAddin

 

Dim Connection As VDF.Vault.Currency.Connections.Connection = edm.EdmSecurity.Instance.VaultConnection()
If Connection IsNot Nothing
	MsgBox("Vault connection exists")
Else
	MsgBox("No Vault connection")
End If
Message 4 of 6

Anonymous
Not applicable

Thanks @JhoelForshav, it works like a charm but I had to add these references:

 

  • Autodesk.Connectivity.Extensibility.Framework.dll
  • Autodesk.Connectivity.WebServices.dll
  • Autodesk.Connectivity.WebServices.Interop.dll
  • Autodesk.DataManagement.Addin.Framework.dll
  • Autodesk.DataManagement.Addin.Vault.dll
  • Autodesk.DataManagement.Client.Framework.dll
  • Autodesk.DataManagement.Client.Framework.Forms.dll
  • Autodesk.DataManagement.Client.Framework.Vault.dll
  • Connectivity.Common.dll
  • Connectivity.InventorAddin.EdmAddin.dll

 

Message 5 of 6

jjstr8
Collaborator
Collaborator
Any idea on how to refresh the connection status? If I lose the network connection to the Vault server, EdmSecurity.Instance.VaultConnection.IsConnected stays true.
0 Likes
Message 6 of 6

MaciejWojda
Enthusiast
Enthusiast

I cannot find Connectivity.InventorAddin.EdmAddin.dll, do you know how to get it? I need it for Vault 2021

 


@Anonymous wrote:

Thanks @JhoelForshav, it works like a charm but I had to add these references:

 

  • Autodesk.Connectivity.Extensibility.Framework.dll
  • Autodesk.Connectivity.WebServices.dll
  • Autodesk.Connectivity.WebServices.Interop.dll
  • Autodesk.DataManagement.Addin.Framework.dll
  • Autodesk.DataManagement.Addin.Vault.dll
  • Autodesk.DataManagement.Client.Framework.dll
  • Autodesk.DataManagement.Client.Framework.Forms.dll
  • Autodesk.DataManagement.Client.Framework.Vault.dll
  • Connectivity.Common.dll
  • Connectivity.InventorAddin.EdmAddin.dll

0 Likes