<?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 Connecting to AutoCAD in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3306773#M57485</link>
    <description>&lt;P&gt;I have a .NET app that I have created to run inside of AutoCAD. &amp;nbsp;It runs inside of AutoCAD and has been tested on both AutoCAD 2010 and 2012. &amp;nbsp;I have also built a standalone applicaiton that is intended to start AutoCAD and netload the in process dll. &amp;nbsp;I have a computer that has 2010 installed and if I compile the application on this machine everything works as it should. &amp;nbsp;If I then run the same standalone application on a computer that only has 2012 installed it doesn't connect. &amp;nbsp;It starts AutoCAD (acad.exe shows up in the task manager) but it can't connect to it. &amp;nbsp;I then tested the opposite scenario. &amp;nbsp;Built the standalone application on a computer that only has 2012 installed and it works with AutoCAD 2012. &amp;nbsp;I then ran that applicaiton on the computer with only AutoCAD 2010 installed and it can't connect. &amp;nbsp;Just like before, acad.exe is started but it doesn't connect and instead gives an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously this would make supporting different versions of AutoCAD require a different executables for the standalone application which seems wrong. &amp;nbsp;I have created a applicaiton that communicates with Inventor and this problem did not occur. &amp;nbsp;Thus, I had assumed it wouldn't be an issue with AutoCAD. &amp;nbsp; Am I doing something wrong that is preventing the different versions from working? &amp;nbsp; Any help would be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2012 01:24:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-01-26T01:24:01Z</dc:date>
    <item>
      <title>Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3306773#M57485</link>
      <description>&lt;P&gt;I have a .NET app that I have created to run inside of AutoCAD. &amp;nbsp;It runs inside of AutoCAD and has been tested on both AutoCAD 2010 and 2012. &amp;nbsp;I have also built a standalone applicaiton that is intended to start AutoCAD and netload the in process dll. &amp;nbsp;I have a computer that has 2010 installed and if I compile the application on this machine everything works as it should. &amp;nbsp;If I then run the same standalone application on a computer that only has 2012 installed it doesn't connect. &amp;nbsp;It starts AutoCAD (acad.exe shows up in the task manager) but it can't connect to it. &amp;nbsp;I then tested the opposite scenario. &amp;nbsp;Built the standalone application on a computer that only has 2012 installed and it works with AutoCAD 2012. &amp;nbsp;I then ran that applicaiton on the computer with only AutoCAD 2010 installed and it can't connect. &amp;nbsp;Just like before, acad.exe is started but it doesn't connect and instead gives an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously this would make supporting different versions of AutoCAD require a different executables for the standalone application which seems wrong. &amp;nbsp;I have created a applicaiton that communicates with Inventor and this problem did not occur. &amp;nbsp;Thus, I had assumed it wouldn't be an issue with AutoCAD. &amp;nbsp; Am I doing something wrong that is preventing the different versions from working? &amp;nbsp; Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2012 01:24:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3306773#M57485</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-26T01:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3308235#M57486</link>
      <description>&lt;P&gt;If you post the code from the stand-alone app that starts AutoCAD then netloads the in-process dll you might get a better response.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2012 22:49:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3308235#M57486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-26T22:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3308319#M57487</link>
      <description>&lt;P class="p1"&gt;Here is the code for connecting to AutoCAD.&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;void&lt;/SPAN&gt; connectAutoCad()&lt;/P&gt;&lt;P class="p1"&gt;{&lt;/P&gt;&lt;P class="p1"&gt;String progID = "Application.AutoCAD";&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;//try to connect an open instance of autoCad&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;acApp = (&lt;SPAN&gt;AcadApplication&lt;/SPAN&gt;)&lt;SPAN&gt;Marshal&lt;/SPAN&gt;.GetActiveObject(progID);&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt;catch&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;//open a new instance autoCad&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt;Type&lt;/SPAN&gt; acType = &lt;SPAN&gt;Type&lt;/SPAN&gt;.GetTypeFromProgID(progID);&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; acApp =(&lt;SPAN&gt;AcadApplication&lt;/SPAN&gt;)&lt;SPAN&gt;Activator&lt;/SPAN&gt;.CreateInstance(acType,&lt;SPAN&gt;true&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class="p1"&gt;}&lt;/P&gt;&lt;P class="p1"&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2012 00:30:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3308319#M57487</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-27T00:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3308587#M57488</link>
      <description>&lt;P&gt;Hi cvaught,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried setting the visibility using "acApp.Visible = true" after "CreateInstance" call ?&lt;/P&gt;
&lt;P&gt;Does AutoCAD then show up ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2012 10:40:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3308587#M57488</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2012-01-27T10:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3308853#M57489</link>
      <description>&lt;P&gt;It throws an exception on that line. &amp;nbsp;Thus acApp is null.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2012 14:08:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3308853#M57489</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-27T14:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3308889#M57490</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 2011 and 2012 installed and it works ok when i launch 2012.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are few things that you may try :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Check the following in the registry - HKEY_CLASSES_ROOT\AutoCAD.Application&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use the CLSID mentioned to search and this should lead you to the&amp;nbsp;acad.exe path that is supposed to get launched. Make sure you do this carefully and dont change anything by mistake.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Try invoking a specific version&amp;nbsp;by providing a&amp;nbsp;different progId such as "AutoCAD.Application.18" and "AutoCAD.Application.18.2".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) See if the issue is specific to a system by trying it on other systems that only have 2012.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2012 14:34:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3308889#M57490</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2012-01-27T14:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3311763#M57491</link>
      <description>&lt;P&gt;So just to confirm, a single excutable that is created on a computer using AutoCAD 2012 should be able to connect to AutoCAD when the application is installed on a computer that only contains AutoCAD 2010?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2012 01:18:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3311763#M57491</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-31T01:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3345205#M57492</link>
      <description>&lt;P&gt;I still haven't found a solution for my problem. &amp;nbsp;Does anyone have experience with connecting to multiple different versions of AutoCAD with a single executable? &amp;nbsp;Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2012 22:10:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3345205#M57492</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-23T22:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3345655#M57493</link>
      <description>&lt;P&gt;Try to get the current version something like this&lt;/P&gt;&lt;P&gt;{code}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim acadver As Object&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acadver = My.Computer.Registry.GetValue("HKEY_CLASSES_ROOT\AutoCAD.Application\CurVer", _&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String.Empty, String.Empty)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If typeOf acadver Is String Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("String acadver: " &amp;amp; acadver.ToString&lt;BR /&gt;end if&lt;/P&gt;&lt;P&gt;{code}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then pull this string to CreateInstance method from&lt;/P&gt;&lt;P&gt;System.Reflection namespace&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~'J'~&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2012 09:08:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3345655#M57493</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2012-02-24T09:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3357161#M57494</link>
      <description>&lt;P&gt;Same problem still exists. &amp;nbsp;It starts acad.exe but cannot connect to it. &amp;nbsp;Any other opitons? &amp;nbsp;This seems like it should be pretty straight forward. &amp;nbsp;How else can a stand along application support multiple versions of AutoCAD?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Mar 2012 21:47:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3357161#M57494</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-03T21:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3357177#M57495</link>
      <description>&lt;P&gt;Both ways is woking for me with A2009 Win7&lt;/P&gt;&lt;P&gt;Try again&lt;/P&gt;&lt;P&gt;{code}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ''1st way&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; Private Function GetAcadVer() As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim acadver As Object&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acadver = My.Computer.Registry.GetValue("HKEY_CLASSES_ROOT\AutoCAD.Application\CurVer", _&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String.Empty, String.Empty)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If TypeOf acadver Is String Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'MessageBox.Show("String acadver: " &amp;amp; acadver.ToString())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return acadver.ToString()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return Nothing&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return Nothing&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub connectAutoCad()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim acApp As Object = Nothing&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim progID As String = GetAcadVer()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'try to get a current instance of AutoCAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acApp = Marshal.GetActiveObject(progID)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'try to create a new instance of AutoCAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim acType As Type = Type.GetTypeFromProgID(progID)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acApp = Activator.CreateInstance(acType, True)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acApp.GetType().InvokeMember("visible", Reflection.BindingFlags.SetProperty + Reflection.BindingFlags.IgnoreCase, Nothing, acApp, New Object() {True})&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acApp.GetType().InvokeMember("eval", Reflection.BindingFlags.InvokeMethod + Reflection.BindingFlags.IgnoreCase, Nothing, acApp, New Object() {"MsgBox(" + """Hello Discussion group""" + ")"})&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acApp.GetType().InvokeMember("quit", Reflection.BindingFlags.InvokeMethod + Reflection.BindingFlags.IgnoreCase, Nothing, acApp, Nothing)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Marshal.FinalReleaseComObject(acApp)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acApp = Nothing&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;''2nd way&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Private Sub GetAcadApp(ByVal AcadString As String)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim AcadApp As Object = Nothing&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcadApp = GetObject(, "AutoCAD.Application." &amp;amp; AcadString)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcadApp = CreateObject("AutoCAD.Application." &amp;amp; AcadString)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcadApp.GetType().InvokeMember("Visible", Reflection.BindingFlags.SetProperty + Reflection.BindingFlags.IgnoreCase, Nothing, AcadApp, New Object() {True})&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show(AcadApp.GetType().InvokeMember("Name", Reflection.BindingFlags.GetProperty + Reflection.BindingFlags.IgnoreCase, Nothing, AcadApp, Nothing).ToString)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finally&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcadApp.GetType().InvokeMember("Quit", Reflection.BindingFlags.InvokeMethod + Reflection.BindingFlags.IgnoreCase, Nothing, AcadApp, Nothing)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Marshal.FinalReleaseComObject(AcadApp)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcadApp = Nothing&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;BR /&gt;''example:&lt;BR /&gt;''on button click call&lt;BR /&gt;'' GetAcadApp("17")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{code}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800080" face="arial,helvetica,sans-serif"&gt;~'J'~&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Mar 2012 22:44:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3357177#M57495</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2012-03-03T22:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3357225#M57496</link>
      <description>&lt;P&gt;Still doesn't work. &amp;nbsp;Just to confirm, did the code you use work with just one version of AutoCAD or have you been able to use it to connect to different versions on different machines using the same executable? &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Mar 2012 03:56:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3357225#M57496</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-04T03:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3357331#M57497</link>
      <description>&lt;P&gt;I'm working nowhere, sorry&lt;/P&gt;&lt;P&gt;just tested&amp;nbsp;this code&amp;nbsp;on my home machine -&amp;nbsp;A2009(eng) release&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Mar 2012 11:45:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3357331#M57497</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2012-03-04T11:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3649760#M57498</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;Same problem still exists. &amp;nbsp;It starts acad.exe but cannot connect to it. &amp;nbsp;Any other opitons? &amp;nbsp;This seems like it should be pretty straight forward. &amp;nbsp;How else can a stand along application support multiple versions of AutoCAD?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no way that the same exe can support multiple versions of AutoCAD.&lt;/P&gt;&lt;P&gt;Different version or OS (X64 ,X86) of AutoCAD has different library.&lt;/P&gt;&lt;P&gt;The best way is to recomplie another project (the same code but has different reference librayies).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Huilung Chen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2012 05:24:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/connecting-to-autocad/m-p/3649760#M57498</guid>
      <dc:creator>Hui-lung.Chen</dc:creator>
      <dc:date>2012-10-08T05:24:18Z</dc:date>
    </item>
  </channel>
</rss>

