By Wayne Brill
You may want to get the login from the AutoCAD 2014 Vault Add-In. Here is a VB.NET example that does this. Please keep in mind that this approach has not been through any QA and is not officially supported. It does work in my tests however.
Download AutoCAD_Vault_2014_get_Connection
This discussion group thread has a suggestion for getting the login from the AutoCAD 2013 Vault Add-In.
Here is the command from the AutoCAD VB.NET the project:
<CommandMethod("MyGroup", "testVault", "testVault",
CommandFlags.Modal)> _
PublicSub test_Vault()
Dim ed AsEditor = Application.DocumentManager.
MdiActiveDocument.Editor
Dim myConnection As VDF.Vault.Currency.
Connections.Connection = Nothing
' Get the Vault connection from
' the AutoCAD Vault log in
myConnection = Connectivity.Application.
VaultBase.ConnectionManager.
Instance.Connection()
If myConnection IsNothingThen
ed.WriteMessage _
("Unable to get Vault connection")
Return
EndIf
' test the connection
Dim myRootFolder AsFolder =
myConnection.FolderManager.RootFolder()
Dim myWebServ AsWebServiceManager =
myConnection.WebServiceManager
Dim myDocServ AsDocumentService =
myWebServ.DocumentService
Dim MyFolder AsFolder = Nothing
Try
' Need to change the string argument
' to a Folder in your vault
MyFolder = myDocServ.
GetFolderByPath("$/wb_Excel_Files")
ed.WriteMessage("$/wb_Excel_Files created: " _
& MyFolder.CreateDate.ToString())
Catch ex As System.Exception
ed.WriteMessage("unable to get Folder. "& _
ex.ToString())
EndTry
EndSub