OK,
Code is below.. A few notes..
1) For the below code, you will only get an event if the user selects to check data in, if they cancel the dialogue. No events.
2) For the below code you will get 1 event for each file checked in (including any local dwf's generated). The event carries the filename being checked in.
3) You can wrapper the code below, in between a document close (before) and document close(after) event, or a vault checkin command activate and vault checkin command deactivate events to filter out the many events you will get.
If you need any more advice on working with the vault objects just let me know, or Doug Redmonds Vault customisation blog is Ace, in particular his 5 webinanars on Vault API on you tube. Its where I learnt anything I know about vault API.
Hope this helps.
You will need references in your project to the vault dll's
For Vault 2016...
C:\Program Files\Autodesk\Vault Professional 2016\Explorer\Autodesk.Connectivity.Extensibility.Framework.dll
C:\Program Files\Autodesk\Vault Professional 2016\Explorer\Autodesk.Connectivity.WebServices.dll
Import the vault webservices namespace.
Imports acw = Autodesk.Connectivity.WebServices
Provide a sub to handle the events
Private Sub check_restrictions(sender As Object, e As acw.CheckinFileCommandEventArgs)
Dim file As acw.File = Nothing
file = GlobalVar.vault_conn.Connection.WebServiceManager.DocumentService.GetLatestFileByMasterId(e.FileMasterId)
'above lines get the file data from vault.
' do some stuff here
End Sub
and finally add a handler to capture the event
AddHandler Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.GetRestrictions, AddressOf check_restrictions
---------------------------------------------------------------------------------------------------------------
There are 3 events you can capture..
GetRestrictions - Fires before A check in event occurs, allows blocking of the check in event (in theory).
Pre - Fires after restrictions have occured
Post - Fires after a check in event has occurred, can be used to determine success or fails.