Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

exit from vault server

2 REPLIES 2
Reply
Message 1 of 3
derembas
423 Views, 2 Replies

exit from vault server

Hello

Could you help me? I want close my existing connection of inventor with vault server using api.

I am trying to use loguot function "Autodesk.DataManagement.Client.Framework.Vault.Library.ConnectionManager.LogOut(conn)", there "conn" is some connection. I can create my new connection, by "Dim conn As Connection = VDF.Vault.Forms.Library.Login(LogSet)", but how should i get already existing connection?

2 REPLIES 2
Message 2 of 3
gavbath
in reply to: derembas

Hi,

 

Depending on where you are starting, will govern the exact solution.

Are you building a Vault Explorer extension? If so, the connection object is available from the IApplication object that is passed to the OnLogOn method when you log into Vault. That is one of the interface members of the IExplorerExtension interface.

 

Here is an example to set up the commonly used web services.

 

[code]

public void OnLogOn(IApplication application)
        {
            try
            {
                conn = application.Connection;
                svcMgr = new ServiceMgr();
                svcMgr.VConn = conn;

                m_docSvc = conn.WebServiceManager.DocumentService;
                svcMgr.DocSvc = m_docSvc;

                m_itemSvc = conn.WebServiceManager.ItemService;
                svcMgr.ItemSvc = m_itemSvc;

                m_winAuthSvc = conn.WebServiceManager.WinAuthService;

                m_fileSvc = conn.WebServiceManager.FilestoreService;
                svcMgr.FileSvc = m_fileSvc;

                m_kvsvc = conn.WebServiceManager.KnowledgeVaultService;
                svcMgr.KvSvc = m_kvsvc;
            }

            catch(Exception Ex)
            {
                System.Windows.Forms.MessageBox.Show(Ex.Message);
            }
        }

[/code]

 

Also, you can access it through e.Context.Application.Connection

 

Hope that helps.

Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube


   

Message 3 of 3
derembas
in reply to: gavbath

Thank you for your answer)
Any help is useful for me.
I am trying to build my own Standalone Application, which can break connection inventor-vault addin and vault sever. My application should to imitate of exit button pressing in inventor-vault-addin, like it showed in the "MyTask.jpg" file.
As I understood, onlogon method fits only for Vault Explorer extensions, and it is not my case, as I think. May be i am not right...
Will your solution be correct in my case? And how can I get IApplication object, for passing it to the OnLogOn method?

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

Post to forums  

Autodesk Design & Make Report