Vault Customization

New Member
Posts: 2
Registered: ‎11-09-2004
Message 1 of 6 (756 Views)
Accepted Solution

Get Securityheader from Vault Login in AutoCAD

756 Views, 5 Replies
02-08-2013 12:09 AM

I wonder if it is possible to get the securityheader from a Vault login in AutoCAD in the same way as in Inventor. In Inventor I add a reference to Connectivity.InventorAddin.EdmAddin.dll but I can' find a similiar reference for AutoCAD.  I have an AutoCAD add-in (written in .NET) that needs to fecth information from Autodesk Vault.

Posts: 799
Registered: ‎12-12-2006
Message 2 of 6 (736 Views)

Re: Get Securityheader from Vault Login in AutoCAD

02-11-2013 02:23 PM in reply to: ellmag

I believe there is another back-door for getting this information inside AutoCAD.  Like with the Inventor add-in, there is no official support for this technique.


If you use the following code from your add-in, you should be able to get the userId and ticket of the current Vault session.


if (VaultExplorerAppBase.Instance == null)


    throw new ApplicationException("Unable to get Vault connection");


VaultConnectionManager connectionMgr = VaultExplorerAppBase.Instance.VaultManager;


if (connectionMgr.Connection.IsSignedIn() == false)


    throw new ApplicationException("Vault connection doesn't exist.");


IWebServiceCredentials credentials = new UserIdTicketCredentials(connectionMgr.Connection.SecurityContext.RemoteHost,






It has dependency on following dlls (which are located in AutoCAD installation directory).  None of these DLLs are part of the supported Vault API.






Doug Redmond
Software Engineer
Autodesk, Inc.

Active Contributor
Posts: 27
Registered: ‎06-24-2013
Message 3 of 6 (540 Views)

Re: Get Securityheader from Vault Login in AutoCAD

07-07-2013 05:29 PM in reply to: ellmag

Hi Doug,


        I need to add a job to Job Processor from AutoCAD (Eg: Publish a drawing file). I have configured jobs and it was working fine with Inventor. Is it possible to do the same with AutoCAD. 


       I have gone through your post " Got no idea in acheiving my functionality.


       Can you provide some samples or reference documents to get vault instance from AutoCAD.



Balaji A

Valued Contributor
Posts: 80
Registered: ‎01-09-2009
Message 4 of 6 (476 Views)

Re: Get Securityheader from Vault Login in AutoCAD

09-11-2013 02:40 AM in reply to: Redmond.D

I would like to use the code from above but I get the folowing error message:

Error 1 'Connectivity.Common.Vault.VaultConnectionManager' does not contain a definition for 'connection' and no extension method 'connection' accepting a first argument of type ....


How can I solve this issue, or is there an other way to check/use the current connection from the user in AutoCAD?

ADN Support Specialist
Posts: 197
Registered: ‎08-25-2004
Message 5 of 6 (463 Views)

Re: Get Securityheader from Vault Login in AutoCAD

09-11-2013 03:04 PM in reply to: RPeter



For 2014 a different call needs to be made. I asked a colleague about this. Here is an excerpt of their reply:


>> >>

To get the connection the add-in is using, they can access the Connectivity.Application.VaultBase.ConnectionManager.Instance.Connection property. This will return the active connection that the Vault add-in is using at that time. If the add-in does not have a valid connection when this property is read, then I believe it will return null.

 << << 


I tested this out and made a blog post about it. (with an VB.NET AutoCAD project for download)




Wayne Brill
Developer Technical Services
Autodesk Developer Network

Valued Contributor
Posts: 80
Registered: ‎01-09-2009
Message 6 of 6 (456 Views)

Re: Get Securityheader from Vault Login in AutoCAD

09-11-2013 10:10 PM in reply to: wayne.brill

Hi Wayne,


Verry nice blog item.

I've edited the code to have a function that will return the connection or nothing instead.

Imports ADCFWV = Autodesk.DataManagement.Client.Framework.Vault
Module mod_LogIn
    Public Function GetMyVaultConnection() As ADCFWV.Currency.Connections.Connection
        Dim MyConnection = Connectivity.Application.VaultBase.ConnectionManager.Instance.Connection
        If Not MyConnection Is Nothing And MyConnection.IsConnected Then
            Return MyConnection
            Return Nothing
        End If
    End Function
End Module




You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community