Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a question about Applicationevents when coding a addin.
I'm using the the autodesk template for visual studio, but have trouble triggering the applicationevents.
I created a new .vb file in the addin with this code:
Imports System.Runtime.InteropServices
Imports Inventor
Imports Microsoft.Win32
Module MyNewModule
Public Class MyNewClass
Public WithEvents oApplicationEvents As Inventor.ApplicationEvents
Private Sub MyNewClass_Initialize()
oApplicationEvents = oApp.ApplicationEvents
end sub
Private Sub oApplicationEvents_OnSaveDocument(ByVal DocumentObject As Document, ByVal BeforeOrAfter As EventTimingEnum, ByVal Context As NameValueMap, HandlingCode As HandlingCodeEnum)
If BeforeOrAfter = EventTimingEnum.kAfter Then
MsgBox("Hello there!")
End If
end sub
end Class
end module
I know that I have to do something like this, but I'm having trouble making the msgbox/sub trigger.
I found this in The API Documentation : https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-A7B286A0-5234-49B0-8C89-00411A6B1173
Can anyone with a bigbrain correct my code? (It's basicly the same as the EventTrigger in inventor)
Thx allot k.
Solved! Go to Solution.