Autocad 2014 crash when updating UDP on AddFileEvents_Post.

Autocad 2014 crash when updating UDP on AddFileEvents_Post.

Anonymous
Not applicable
400 Views
1 Reply
Message 1 of 2

Autocad 2014 crash when updating UDP on AddFileEvents_Post.

Anonymous
Not applicable

Hi

 i working on a IWebServiceExtension to update UDP on AddFileEvents_Post. Extention works fine from explorer client on AddFiles.

 When i checkin a file using Autocad Vault client (from vault Ribbon tab) Extention update the file property but Autocad Crash after update action.

 Autocad pop message box with error An error occurred during a vaulting operation. before crash.

 

i am using Autocad and Vault Pro 2014. following is the code i am using to update property.

Thanks

 

        public void UpdateProperty(File file)
        {
            var results = VDF.Vault.Library.ConnectionManager.LogIn("vault2014", "Vault", "Administrator", "", VDF.Vault.Currency.Connections.AuthenticationFlags.Standard, null);
            if (!results.Success) return;
            var connection = results.Connection;

            var VaultExplorerUtil = ExplorerLoader.LoadExplorerUtil(connection.Server, connection.Vault, connection.UserID, connection.Ticket);
            var settings = Settings.LoadSettings(connection.WebServiceManager);

            var number = string.Empty;
            if (settings.DocumentNumberingScheme != null)
                number = connection.WebServiceManager.DocumentService.GenerateFileNumber(settings.DocumentNumberingScheme.SchmID, null);

            var dic = new Dictionary<PropDef, object> { { settings.PropertyToUpdate, number } };
            VaultExplorerUtil.UpdateFileProperties(file, dic);
            VaultExplorerUtil = null;
        }

 

0 Likes
401 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Hello,

 

First, you shoud setup your development environment to be able to debug you extension.

See this for details: http://justonesandzeros.typepad.com/blog/2010/04/debugging-a-custom-command.html

 

You can also wrap your UpdateProperty code in a try/catch block and pop a message box in you catch block to display the exception message:

using System.Windows.Forms;

void UpdateProperty()
{
	try
	{
		//Your code here
	}
	catch (Exception e)
	{
		MessageBox.Show("UpdateProperty exception!\n" + e.ToString());
	}
}

 

 

Regards,

Pierre

0 Likes