Check connection with Vault

Check connection with Vault

gert-leonvanlier
Collaborator Collaborator
3,713 Views
22 Replies
Message 1 of 23

Check connection with Vault

gert-leonvanlier
Collaborator
Collaborator

I have looked through a large number of forum post about this subject, but nothing that answers my problem.

I have the following code (copied) from this post:

 

 

using Connectivity.InventorAddin.EdmAddin;
using VDF = Autodesk.DataManagement.Client.Framework.Vault;
using System.Windows.Forms;

public void SetupUserInterace(Inventor.ApplicationAddInSite applicationAddInSite, bool firstTime, string clientID)
{
	if (firstTime)
	{
		EdmSecurity edmSecurity = EdmSecurity.Instance;
		var vaultServerName = edmSecurity.GetEdmLoginPreferences().Server;
		var vaultName = edmSecurity.GetEdmLoginPreferences().VaultName;
		var vaultUserName = edmSecurity.GetEdmLoginPreferences().UserName;
		var vaultPassword = edmSecurity.GetEdmLoginPreferences().Password;

		VDF.Results.LogInResult logInResults;
		logInResults = VDF.Library.ConnectionManager.LogIn(vaultServerName, vaultName, vaultUserName, vaultPassword, VDF.Currency.Connections.AuthenticationFlags.Standard, null);

		VDF.Currency.Connections.Connection connection = null;

		if (logInResults.Success)
		{
			connection = logInResults.Connection;
			MessageBox.Show("There is a connection with the Houten Vault.");
		}

	}
}

 

 

 

The trouble I am having is how to get necessary inputs for this method. I wanna call this method at a specific moment in my add in. The add in itself gets the ApplicationAddInSite object, but I can't figure out how to pass it in my method. firstTime I am not sure if necessary? I think I always want to check if the connection still exists.

clientID: is that the Guid of my add in or of the Vault add in for Inventor? If it is the latter, how do I find this value?

 

To add: what I want, is to pass a value to the comment field when checking in a file to the Vault when the user clicks check in.

0 Likes
Accepted solutions (1)
3,714 Views
22 Replies
Replies (22)
Message 21 of 23

matt_jlt
Collaborator
Collaborator

I posted all the info to get you 99% of the way in your other post. Hopefully this helps.

0 Likes
Message 22 of 23

gert-leonvanlier
Collaborator
Collaborator

Thank you! I am getting somewhere.

 

In you OnWindowOpenend sub sharedFunctions is mentioned. What is this?

0 Likes
Message 23 of 23

matt_jlt
Collaborator
Collaborator

I posted the full code with explanation on your other post

https://forums.autodesk.com/t5/inventor-ilogic-api-vba-forum/get-vault-check-in-window/td-p/10629138

Also I explained above that the sharedFunction is just a separate module, and that command is a simple wait command.  I will post the Wait command for you on the other one aswell, just to keep it all together

0 Likes