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

Maybe you can take another route and create your own class with your variable. And then get the object containing your variable in the ilogic rule from your addin. It works something like this. Your StandardAddInServer would look something like this:

<GuidAttribute("[YOUR GUID]"), ComVisible(True)>
Public Class StandardAddInServer
    Implements Inventor.ApplicationAddInServer

    Private _myVariableObject As MyVariableObject

    Public Sub Activate(AddInSiteObject As ApplicationAddInSite, FirstTime As Boolean) Implements ApplicationAddInServer.Activate
        _myVariableObject = New MyVariableObject()
        _myVariableObject.MyVariable = "TEST"
    End Sub

    Public ReadOnly Property Automation As Object Implements ApplicationAddInServer.Automation
        Get
            Return _myVariableObject
        End Get
    End Property
End Class

Public Class MyVariableObject
    Public Property MyVariable As String
End Class

Notice:

  • Notice the GUID on line 1. You need it in the iLogic rule.
  • on line 19, 20 en 21: we have a class that we can use in the ilogic rule
  • on line 5,  8 en 9: we initialize the variable and  set some value
  • on line 12 to 16: You find something that is not in the tutorial. but here the magic happens. This function can be called from within the iLogic rule. And it returns our object.

Now in your iLogic rule you can do this:

Dim addIn As ApplicationAddIn = ThisApplication.ApplicationAddIns.ItemById("{[YOUR GUID]}")
Dim myVariableObject = addIn.Automation

msgbox(myVariableObject.MyVariable)

On line 1 and 2 you get the object from your addin.

Then you can use it. For example in a MsgBox like on line 4 :beaming_face_with_smiling_eyes:. It this case that would look like this:

JelteDeJong_0-1732312927906.png

 

 

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com