Vault Connection when Catching Events from AutoCAD Mechanical

Vault Connection when Catching Events from AutoCAD Mechanical

H_MERTENS
Contributor Contributor
406 Views
1 Reply
Message 1 of 2

Vault Connection when Catching Events from AutoCAD Mechanical

H_MERTENS
Contributor
Contributor

Hello, I am trying to catch a Vault event from Mechanical. This works fine. But when I pass thru the Vault connection from the Vault Client it is empty. In Inventor this works and I have the Vault connection. In Mechanical this doesn't work. I can't get the connection to Vault. In the Vault AddIn I create a public shared variable like this

Public Shared _connection As VDF.Vault.Currency.Connections.Connection

At the "OnLogOn" Sub from the IExtension I get the Vault connection and pass it thru to the variable like this

_connection = application.Connection

When I now use this _connection in an Event like "UpdateFileLifecycleStateEventPre" while the user changes the state in the Inventor client, it works and I have the connection to Vault. But when the user changes the state in Mechaical the _connection is empty. Why is the connection not available in Mechanical and how do I get the active Vault connection then?

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

thomas.schneider
Contributor
Contributor

Hi Heiko,
I'm not sure but may this helps:
https://adndevblog.typepad.com/manufacturing/2013/09/autocad-2014-vault-add-in-connection.html 
I use it since a while andf it works fine for me.Smiley Happy
For handling Events I'd recommend to use a Web Service Extension - it catches every event regardless which type of client application triggered it. I think this is easier hence you can do your handling in one piece of code, no need to create code for each client application you need to support. Nice approach for all lazy guys like me Smiley Wink

Cheers,

Thomas

0 Likes