This is possible, but it is little bit tricky. The best way (IMHO) is to implement your own API and expose it thru Automation property of the AddIn.
Then you can get the AddIn by its ID and then get Automation property, re-type value to your known API type and then you can call any method exposed by this object.
NOTE: Re-type is not necessary (but recommended) when you call methods by late binding (VB.NET)
EDIT:
Here is minimalistic example of custom API implementation
namespace MyAddInWithApi
{
[Guid("GUID-OF-YOUR-ADDIN-HERE")]
public class MyAddInServerWithApi : Inventor.ApplicationAddInServer
{
private Application inventor;
private MyAddInApi myAddInApi;
public void Activate(ApplicationAddInSite AddInSiteObject, bool FirstTime)
{
inventor = AddInSiteObject.Application;
myAddInApi = new MyAddInApi(inventor);
}
public void Deactivate()
{
myAddInApi = null;
}
public void ExecuteCommand(int CommandID)
{
//OBSOLETE, DO NOTHING
}
/// <summary>
/// Gets the IUnknown of the object implemented inside the AddIn that supports AddIn-specific API.
/// </summary>
public object Automation
{
get
{
return myAddInApi;
}
}
}
public class MyAddInApi
{
private readonly Application inventor;
public MyAddInApi(Application inventor)
{
this.inventor = inventor;
}
public void SetApplicationCaption(string caption)
{
inventor.Caption = caption;
}
}
}
Here is example of custom API call
namespace MyExternalApp
{
...
void CallMyApiMethodExample()
{
var myAddInServerWithApi = inventor.ApplicationAddIns.ItemById["{GUID-OF-YOUR-ADDIN-HERE}"];
var myAddInApi = myAddInServerWithApi.Automation as MyAddInApi;
myAddInApi.SetApplicationCaption("It works :-)");
}
...
}