<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Remoting in AutoCAD in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/remoting-in-autocad/m-p/1879583#M79147</link>
    <description>Hi.&lt;BR /&gt;
I've got a problem using remoting with AutoCAD.&lt;BR /&gt;
I want to implement a kind of server in AutoCAD that enables external processes to get access to AutoCAD functions.&lt;BR /&gt;
&lt;BR /&gt;
I have a VS-solution with this layout:&lt;BR /&gt;
AutoCADServer (dll, class implements IExtensibleApplication)&lt;BR /&gt;
AutoCADWorker (dll, derived from MarshalByObjReg)&lt;BR /&gt;
Client1 (exe)&lt;BR /&gt;
&lt;BR /&gt;
I want to implement certain functionality in AutoCADWorker, like opening DWGs, plotting, some other stuff...&lt;BR /&gt;
The user now starts Client1 and is able to use this functionality exposed by AutoCADWorker.&lt;BR /&gt;
At least, this is the idea.&lt;BR /&gt;
&lt;BR /&gt;
To do this, I have this code:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
public class AutoCADServer : IExtensionApplication&lt;BR /&gt;
{&lt;BR /&gt;
  public void Initialize()&lt;BR /&gt;
  {&lt;BR /&gt;
    RemotingConfiguration.Configure(path_to_server_config, false);&lt;BR /&gt;
  }&lt;BR /&gt;
  // Snip some other unrelated stuff&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
public class AutoCADWorker : MarshalByRefObject&lt;BR /&gt;
{&lt;BR /&gt;
  public void DoSomething()&lt;BR /&gt;
  {&lt;BR /&gt;
    // does something nice in AutoCAD&lt;BR /&gt;
  }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
public partial class Form1 : Form&lt;BR /&gt;
{&lt;BR /&gt;
  RemotingConfiguration.Configure(path_to_client_config, false);&lt;BR /&gt;
  AutoCADWorker.AutoCADWorker remoteObject = (AutoCADWorker.AutoCADWorker)Activator.GetObject(typeof(AutoCADWorker.AutoCADWorker), "tcp://localhost:8989/AutoCADServer");&lt;BR /&gt;
  remoteObject.DoSomething();&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The config files look like this (&amp;lt; replaced by [):&lt;BR /&gt;
server_config:&lt;BR /&gt;
&lt;BR /&gt;
[configuration]&lt;BR /&gt;
   [system.runtime.remoting]&lt;BR /&gt;
      [application]&lt;BR /&gt;
         [service]&lt;BR /&gt;
            [wellknown &lt;BR /&gt;
               mode="Singleton" &lt;BR /&gt;
               type="AutoCADWorker.AutoCADWorker, AutoCADWorker" &lt;BR /&gt;
               objectUri="AutoCADServer"&lt;BR /&gt;
            /]&lt;BR /&gt;
         [/service]&lt;BR /&gt;
         [channels]&lt;BR /&gt;
            [channel ref="tcp" port="8989"/]&lt;BR /&gt;
         [/channels]&lt;BR /&gt;
      [/application]&lt;BR /&gt;
   [/system.runtime.remoting]&lt;BR /&gt;
[/configuration]&lt;BR /&gt;
&lt;BR /&gt;
client_config:&lt;BR /&gt;
[configuration]&lt;BR /&gt;
   [system.runtime.remoting]&lt;BR /&gt;
      [application]&lt;BR /&gt;
         [client]&lt;BR /&gt;
            [wellknown &lt;BR /&gt;
               type="AutoCADWorker.AutoCADWorker, AutoCADWorker"&lt;BR /&gt;
               url="tcp://localhost:8989/AutoCADServer"&lt;BR /&gt;
            /]&lt;BR /&gt;
         [/client]&lt;BR /&gt;
      [/application]&lt;BR /&gt;
   [/system.runtime.remoting]&lt;BR /&gt;
[/configuration]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Now when I try to load the plugin in AutoCAD, calling RemotingConfiguration.Configure raises an exception, complaining about already having registered a channel named "tcp".&lt;BR /&gt;
&lt;BR /&gt;
Using Process Explorer, I figured that AutoCAD already opens some .NET channels, appearently, there's really another one named "tcp".&lt;BR /&gt;
My problem is I don't know how I should give the channel a different name, as there's only an attribute "displayName" for the channel-tag in the config,&lt;BR /&gt;
but according to MS documentation this isn't used by applications but only to display the name in .NET config tools.&lt;BR /&gt;
&lt;BR /&gt;
Has anyone done this or something similar before and could help me with this?&lt;BR /&gt;
I need to get this working soon, I already spend some days with this stuff...&lt;BR /&gt;
&lt;BR /&gt;
Best Regards&lt;BR /&gt;
Christian Nitschkowski</description>
    <pubDate>Fri, 02 Feb 2007 08:39:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-02-02T08:39:32Z</dc:date>
    <item>
      <title>Remoting in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/remoting-in-autocad/m-p/1879583#M79147</link>
      <description>Hi.&lt;BR /&gt;
I've got a problem using remoting with AutoCAD.&lt;BR /&gt;
I want to implement a kind of server in AutoCAD that enables external processes to get access to AutoCAD functions.&lt;BR /&gt;
&lt;BR /&gt;
I have a VS-solution with this layout:&lt;BR /&gt;
AutoCADServer (dll, class implements IExtensibleApplication)&lt;BR /&gt;
AutoCADWorker (dll, derived from MarshalByObjReg)&lt;BR /&gt;
Client1 (exe)&lt;BR /&gt;
&lt;BR /&gt;
I want to implement certain functionality in AutoCADWorker, like opening DWGs, plotting, some other stuff...&lt;BR /&gt;
The user now starts Client1 and is able to use this functionality exposed by AutoCADWorker.&lt;BR /&gt;
At least, this is the idea.&lt;BR /&gt;
&lt;BR /&gt;
To do this, I have this code:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
public class AutoCADServer : IExtensionApplication&lt;BR /&gt;
{&lt;BR /&gt;
  public void Initialize()&lt;BR /&gt;
  {&lt;BR /&gt;
    RemotingConfiguration.Configure(path_to_server_config, false);&lt;BR /&gt;
  }&lt;BR /&gt;
  // Snip some other unrelated stuff&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
public class AutoCADWorker : MarshalByRefObject&lt;BR /&gt;
{&lt;BR /&gt;
  public void DoSomething()&lt;BR /&gt;
  {&lt;BR /&gt;
    // does something nice in AutoCAD&lt;BR /&gt;
  }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
public partial class Form1 : Form&lt;BR /&gt;
{&lt;BR /&gt;
  RemotingConfiguration.Configure(path_to_client_config, false);&lt;BR /&gt;
  AutoCADWorker.AutoCADWorker remoteObject = (AutoCADWorker.AutoCADWorker)Activator.GetObject(typeof(AutoCADWorker.AutoCADWorker), "tcp://localhost:8989/AutoCADServer");&lt;BR /&gt;
  remoteObject.DoSomething();&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The config files look like this (&amp;lt; replaced by [):&lt;BR /&gt;
server_config:&lt;BR /&gt;
&lt;BR /&gt;
[configuration]&lt;BR /&gt;
   [system.runtime.remoting]&lt;BR /&gt;
      [application]&lt;BR /&gt;
         [service]&lt;BR /&gt;
            [wellknown &lt;BR /&gt;
               mode="Singleton" &lt;BR /&gt;
               type="AutoCADWorker.AutoCADWorker, AutoCADWorker" &lt;BR /&gt;
               objectUri="AutoCADServer"&lt;BR /&gt;
            /]&lt;BR /&gt;
         [/service]&lt;BR /&gt;
         [channels]&lt;BR /&gt;
            [channel ref="tcp" port="8989"/]&lt;BR /&gt;
         [/channels]&lt;BR /&gt;
      [/application]&lt;BR /&gt;
   [/system.runtime.remoting]&lt;BR /&gt;
[/configuration]&lt;BR /&gt;
&lt;BR /&gt;
client_config:&lt;BR /&gt;
[configuration]&lt;BR /&gt;
   [system.runtime.remoting]&lt;BR /&gt;
      [application]&lt;BR /&gt;
         [client]&lt;BR /&gt;
            [wellknown &lt;BR /&gt;
               type="AutoCADWorker.AutoCADWorker, AutoCADWorker"&lt;BR /&gt;
               url="tcp://localhost:8989/AutoCADServer"&lt;BR /&gt;
            /]&lt;BR /&gt;
         [/client]&lt;BR /&gt;
      [/application]&lt;BR /&gt;
   [/system.runtime.remoting]&lt;BR /&gt;
[/configuration]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Now when I try to load the plugin in AutoCAD, calling RemotingConfiguration.Configure raises an exception, complaining about already having registered a channel named "tcp".&lt;BR /&gt;
&lt;BR /&gt;
Using Process Explorer, I figured that AutoCAD already opens some .NET channels, appearently, there's really another one named "tcp".&lt;BR /&gt;
My problem is I don't know how I should give the channel a different name, as there's only an attribute "displayName" for the channel-tag in the config,&lt;BR /&gt;
but according to MS documentation this isn't used by applications but only to display the name in .NET config tools.&lt;BR /&gt;
&lt;BR /&gt;
Has anyone done this or something similar before and could help me with this?&lt;BR /&gt;
I need to get this working soon, I already spend some days with this stuff...&lt;BR /&gt;
&lt;BR /&gt;
Best Regards&lt;BR /&gt;
Christian Nitschkowski</description>
      <pubDate>Fri, 02 Feb 2007 08:39:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/remoting-in-autocad/m-p/1879583#M79147</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-02-02T08:39:32Z</dc:date>
    </item>
  </channel>
</rss>

