Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

how will the vb code look like if I wanted til use before save trigger in an exe program ?

Darkforce_the_ilogic_guy
Advisor

how will the vb code look like if I wanted til use before save trigger in an exe program ?

Darkforce_the_ilogic_guy
Advisor
Advisor

how will the vb code look like if I wanted til use before save trigger in an exe program ?

 

I would like to create a program that run some ilogic code by start an exe file...that run. while I use inventor

 

 

I dont want to use that inventor build in version.  because I wanted to a more complex control of with ilogic that might be run. Maybe as a group of users or as each user level... or maybe multi profile that the users can easily change betwine.

 

but to start with I just need to know how to use the trigger form the exe program

 

 

 

0 Likes
Reply
149 Views
1 Reply
Reply (1)

Cadkunde.nl
Collaborator
Collaborator

You can use handlers to let your code respond to events in Inventor.

I use this for application events in my visual studio project:

 

Public Class ApplicationEvents
Implements Inventor.ApplicationAddInServer
Private AppEvents As Inventor.ApplicationEvents

Public InventorApp As Inventor.Application

 

Public Sub Activate(siteObj As Inventor.ApplicationAddInSite, loaded1stTime As Boolean) Implements ApplicationAddInServer.Activate

InventorApp = siteObj.Application

AppEvents = InventorApp.ApplicationEvents

AddHandler AppEvents.OnActivateDocument, AddressOf oAppEvents_OnActivateDocument

End Sub

 

Private Sub oAppEvents_OnActivateDocument(ByVal DocumentObject As Inventor._Document, ByVal BeforeOrAfter As Inventor.EventTimingEnum, ByVal Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) 'Handles oAppEvents.OnActivateDocument
If BeforeOrAfter = EventTimingEnum.kBefore Then
'your code here
End If
End Sub

 

Public Sub Deactivate() Implements ApplicationAddInServer.Deactivate

 

If InventorApp IsNot Nothing Then
Marshal.FinalReleaseComObject(InventorApp)
End If

End Sub

0 Likes