Vb.Net "Addin" exit Sub on Closing a Part Document
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anybody help????
I have the following "Sub" in a Vb.Net "Addin".....
Private Sub m_applicationEvents_OnCloseDocument(DocumentObject As Inventor._Document, FullDocumentName As String, BeforeOrAfter As Inventor.EventTimingEnum, Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles m_applicationEvents.OnCloseDocument
If BeforeOrAfter = EventTimingEnum.kBefore Then
If m_inventorApplication.ActiveDocument.DocumentType = DocumentTypeEnum.kPartDocumentObject Or DocumentTypeEnum.kAssemblyDocumentObject Or DocumentTypeEnum.kDrawingDocumentObject Then
Try
Dim invVBAProject As InventorVBAProject = m_inventorApplication.VBAProjects.Item(1)
Dim invModule As InventorVBAComponent = invVBAProject.InventorVBAComponents.Item("Module04")
Dim invSub As InventorVBAMember = invModule.InventorVBAMembers.Item("OnClose")
invSub.Execute()
' DO YOU WANT TO CLOSE THE PART YES/NO?
' IF I SELECT "NO" - DO NOT CLOSE THE PART
Catch ex As Exception
End Try
End If
End If
End Sub
All I want to do (For a test only!!!) is to add a MsgBox saying "Do you really want to close Part Yes/No"
Selecting "Yes" will work OK because there will be no change to the above code!
If I select "No" I want to exit the addin so that the current part does not close.
Does anybody know how I can do this?
Many thans in advance!
Darren