By Adam Nagy
If you want to create your add-in in a way that its functionality can also be accessed by other programs (e.g. from VBA) then there are two ways to do it:
a) Use ControlDefinition object
Most add-ins implement ControlDefinition objects, which are hooked up to controls in the Inventor User Interface. When the user clicks that control (mainly buttons) then your code can run to do its thing. These ControlDefintion objects can also be accessed by other programs, just like the ones Inventor exposes. Once you found the ControlDefinition object you need you can call its Execute or Execute2 method in order to run it:
Running Commands Using the API
&
Execute vs Execute2 of ControlDefinition
You can also send parameters to a command in the form of a string. Your add-in then could call PeekPrivateEvent to access that data:
Provide command parameters using PostPrivateEvent
b) Implement Automation property
Your add-in could also implement the Automation property of the ApplicationAddInServer class as described in this blog post:
Connect to an Inventor add-in an external application
Through the Automation property you can expose an object that can have any functions and properties that you want.