There is a second option (that I personally prefer). This option has 2 advantages. In many cases, you don't have to change your adding. There is no need to create/use the Inventor.ApplicationAddInServer interface property Automation. The interface property Automation will always return a object of the type object. maybe not a big deal in iLogic/vb.net (but is very annoying in languages like c#) also you will lose the IntelliSense (code completion) in your code editor.
What you can do: In your rule, add a reference to the DLL of your adding and call its objects directly. For example, you have an adding with the following object:

then you can use them like this in your rule:
AddReference "c:\PATH\To\MyAddin.dll"
Imports MyAddon.NameSpace
' These 2 lines should be at the start of your rule!
Dim myObject As MyObject(ThisApplication)
myObject.showActiveDocumentName()
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.

Blog: hjalte.nl - github.com