- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
This might lean to Vault customization but it's about a specific step in Inventor.
I'm trying to do some things before the user can check something into Vault from Inventor.
I want to zoom to fit and check some iproperties.
I'm try to achieve this through an addin written in vb.net for Inventor 2022 with Vault professional 2022.
I think I have to find the right event for this, I did find how to do that. (https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/handle-documentsercive-checkinfileev... & https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/how-to-run-code-throuh-api-before-va... , I also found this, https://forums.autodesk.com/t5/inventor-ideas/check-in-as-an-event-trigger-for-ilogic-rules/idc-p/12... , where it claims an even trigger for iLogic is added that runs on check into Vault, but I tried 2024 and I can see the new Vault iLogic code, I can't find any Vault event triggers.)
I already knew that, even though in the UI it's called "Check In" , it's actually either Check in or Add file.
So, I ended up with some code that works:
Friend Class VaultEvents
Public Sub New()
AddHandler Autodesk.Connectivity.WebServices.DocumentService.AddFileEvents.GetRestrictions, AddressOf OnAddFileGetRestrictions
AddHandler Autodesk.Connectivity.WebServices.DocumentService.AddFileEvents.Pre, AddressOf OnAddFilePre
AddHandler Autodesk.Connectivity.WebServices.DocumentService.AddFileEvents.Post, AddressOf OnAddFilePost
AddHandler Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.GetRestrictions, AddressOf OnCheckInGetRestrictions
AddHandler Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.Pre, AddressOf OnCheckIn
AddHandler Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.Post, AddressOf OnCheckPost
AddHandler MyEdmSecurity.VaultConnection.WebServiceManager.DocumentService.PostInvokeEvents, AddressOf PostInvokeEvents
End Sub
Private Sub OnAddFileGetRestrictions()
MessageBox.Show("Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.GetRestrictions")
End Sub
Private Sub OnAddFilePre()
MessageBox.Show("Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.Pre")
End Sub
Private Sub OnAddFilePost()
MessageBox.Show("Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.GetPost")
End Sub
Private Sub OnCheckInGetRestrictions()
MessageBox.Show("Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.GetRestrictions")
End Sub
Private Sub OnCheckIn()
MessageBox.Show("Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.Pre")
End Sub
Private Sub OnCheckPost()
MessageBox.Show("Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.Post")
End Sub
Private Sub PostInvokeEvents()
MessageBox.Show("MyEdmSecurity.VaultConnection.WebServiceManager.DocumentService.PostInvokeEvents")
End Sub
End Class
However, the event I look for isn't there, since they all come too late.
I'm hoping to find something between A and B.
Although, C could work for checking iproperties, but how do I abort the checkin? (instead of the message box)
Of course, I could also replace the check in button and run my code first and then use the command manger to "click" on the check in button. basically what the 2024 iLogic does:
ThisDoc.Save
Try
Dim oControlDef As Inventor.ControlDefinition
oControlDef = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop")
oControlDef.Execute2(True)
Catch ex As Exception
Logger.Error("Check-In failed; likely, the file wasn't checked out.")
End Try
But there are a lot of places where that button located and I rather don't go that way.
Solved! Go to Solution.