<?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 Re: Get instance AutoCAD with c# in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/get-instance-autocad-with-c/m-p/1497865#M83232</link>
    <description>This is just something on the side, but you CAN call some of those custom methods that VB programmers are so used to (in C#). You do so by using the Microsoft.VisualBasic namespace.&lt;BR /&gt;
&lt;BR /&gt;
For example: you can get the Autocad application object by using &lt;BR /&gt;
Microsoft.VisualBasic.Interaction.GetObject("", "AutoCAD.Application");&lt;BR /&gt;
&lt;BR /&gt;
However. the solution posted previously is more correct, since that's what the Marshal class is for. This is just FYI.</description>
    <pubDate>Tue, 21 Feb 2006 00:21:51 GMT</pubDate>
    <dc:creator>jbooth</dc:creator>
    <dc:date>2006-02-21T00:21:51Z</dc:date>
    <item>
      <title>Get instance AutoCAD with c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-instance-autocad-with-c/m-p/1497862#M83229</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
In order to create a AutoCAD instance with c# is necessary this source code:&lt;BR /&gt;
&lt;BR /&gt;
private Autodesk.AutoCAD.Interop.AcadApplicationClass _app = new Autodesk.AutoCAD.Interop.AcadApplicationClass();&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Is it possible get an existing instance of AutoCAD with c#?&lt;BR /&gt;
&lt;BR /&gt;
thanx</description>
      <pubDate>Wed, 30 Nov 2005 10:00:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-instance-autocad-with-c/m-p/1497862#M83229</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-30T10:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get instance AutoCAD with c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-instance-autocad-with-c/m-p/1497863#M83230</link>
      <description>System.Runtime.InteropServices.Marshal.GetActiveObject(&lt;ACADPROGID&gt;)&lt;BR /&gt;
--&lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JJLASECA&gt; wrote in message news:5025254@discussion.autodesk.com...&lt;BR /&gt;
Hello,&lt;BR /&gt;
&lt;BR /&gt;
In order to create a AutoCAD instance with c# is necessary this source code:&lt;BR /&gt;
&lt;BR /&gt;
private Autodesk.AutoCAD.Interop.AcadApplicationClass _app = new&lt;BR /&gt;
Autodesk.AutoCAD.Interop.AcadApplicationClass();&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Is it possible get an existing instance of AutoCAD with c#?&lt;BR /&gt;
&lt;BR /&gt;
thanx&lt;/JJLASECA&gt;&lt;/ACADPROGID&gt;</description>
      <pubDate>Thu, 08 Dec 2005 22:02:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-instance-autocad-with-c/m-p/1497863#M83230</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-12-08T22:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get instance AutoCAD with c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-instance-autocad-with-c/m-p/1497864#M83231</link>
      <description>You can start acad as a process by:&lt;BR /&gt;
&lt;BR /&gt;
Process myProcess = new Process();&lt;BR /&gt;
myProcess.StartInfo.FileName = acadFilePath + "acad.exe";&lt;BR /&gt;
myProcess.StartInfo.WindowStyle = myProcessssWindowStyle.Hidden;&lt;BR /&gt;
myProcess.Start();&lt;BR /&gt;
object obj = null;&lt;BR /&gt;
obj = Marshal.GetActiveObject("AutoCAD.Application");&lt;BR /&gt;
&lt;BR /&gt;
obj now points to an autocad object&lt;BR /&gt;
&lt;BR /&gt;
or if you want to get the process:&lt;BR /&gt;
System.Diagnostics.Process [] p = Process.GetProcessesByName("acad");&lt;BR /&gt;
&lt;BR /&gt;
hope this helps</description>
      <pubDate>Mon, 20 Feb 2006 20:27:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-instance-autocad-with-c/m-p/1497864#M83231</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-02-20T20:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get instance AutoCAD with c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-instance-autocad-with-c/m-p/1497865#M83232</link>
      <description>This is just something on the side, but you CAN call some of those custom methods that VB programmers are so used to (in C#). You do so by using the Microsoft.VisualBasic namespace.&lt;BR /&gt;
&lt;BR /&gt;
For example: you can get the Autocad application object by using &lt;BR /&gt;
Microsoft.VisualBasic.Interaction.GetObject("", "AutoCAD.Application");&lt;BR /&gt;
&lt;BR /&gt;
However. the solution posted previously is more correct, since that's what the Marshal class is for. This is just FYI.</description>
      <pubDate>Tue, 21 Feb 2006 00:21:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-instance-autocad-with-c/m-p/1497865#M83232</guid>
      <dc:creator>jbooth</dc:creator>
      <dc:date>2006-02-21T00:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get instance AutoCAD with c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-instance-autocad-with-c/m-p/1497866#M83233</link>
      <description>Hello everybody,&lt;BR /&gt;
&lt;BR /&gt;
I used something similar to run a #net code called by an icon. That mean I need to find the existing AcadProcess and not open an new Acad instance.&lt;BR /&gt;
But I have a problem: If different instances of Acad are opened, it always find the first Acad instance. What I try to do is finding the calling Acad instance, what's the instance where click the icon.&lt;BR /&gt;
But how to do ?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for code, help or advices,&lt;BR /&gt;
Jean-Marc &lt;BR /&gt;
&lt;BR /&gt;
PS: I'm under AcadMap2004.</description>
      <pubDate>Fri, 15 Aug 2008 15:31:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-instance-autocad-with-c/m-p/1497866#M83233</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-15T15:31:29Z</dc:date>
    </item>
  </channel>
</rss>

