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

How to use iLogic in AddIn

I am looking for a way to create a few variables (including the Vault database logged in to) at the start of an Inventor session, which will be kept up to date during the session based on some event handlers (already functional in an iLogic-rule). These values ​​are important because they determine whether triggered rules can be run or not. I want to avoid having to set this value over and over again, because it causes a noticeable delay for larger assemblies.

 

This must probably be an add-in, as iLogic doesn't seem to become functional until the first document is available. I have added references to several iLogic libraries.

Furthermore I thought the following should work, but apparently I lack some knowledge of VB.net. It's just a MyCode.addin and a StandardAddInServer.vb

 

 

 

Public Class StandardAddInServer
    Implements Inventor.ApplicationAddInServer
    'Application events object
    Private WithEvents MyAppEvents As ApplicationEvents
    Public ReadOnly SharedVariable As ISharedVariable

Public Sub Activate(AddInSiteObject As ApplicationAddInSite, FirstTime As Boolean) Implements ApplicationAddInServer.Activate

    MessageBox.Show("At the beginning of ApplicationAddInServer.Activate")
    If Not SharedVariable.Exists("ActiveDatabase") Then
        SharedVariable("ActiveDatabase") = "Test"
    End If
    MessageBox.Show("At the end of ApplicationAddInServer.Activate")

End Sub
End Class

 

 

 

 AddIn is loaded. Messageboxes are shown. How to correctly approach the ISharedVaribale interface is a mystery to me.

 

Can someone give me a push in the right direction?

Thanks!

 

René van der Starre