I don't know Arno, I've tried doing late binding but I keep getting an exception.
the module
namespace RxNetArno
{
[Guid("D6F88E95-8A27-4ae6-B6DE-0542A0FC7039")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface _ComCommands
{
[DispId(1)]
void test02();
}
[Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("RxNetArno.Commands")]
public class ComCommands : _ComCommands
{
public ComCommands() { }
public void test02()
{
var app = Application.AcadApplication as AcadApplication;
var doc = app.ActiveDocument;
try
{
double[] pnt1 = new double[]{0,0,0};
double[] pnt2 = new double[]{100,100,0};
var line = doc.ModelSpace.AddLine(pnt1, pnt2);
}
catch (System.Exception ex)
{
doc.Utility.Prompt(String.Format("\n{0}", ex.Message));
}
}
}
}
and controller .exe
private void button1_Click(object sender, EventArgs e)
{
try
{
Type ComCommands = Type.GetTypeFromProgID("RxNetArno.Commands");
object ComCommandsObject = Activator.CreateInstance(ComCommands);
ComCommands.InvokeMember("test02", BindingFlags.Instance, null, ComCommandsObject, null);
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message +"\n" + ex.Source);
}
}