<?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: Getting the Active AcadApplication in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/getting-the-active-acadapplication/m-p/300917#M67182</link>
    <description>"manoj_vest" &lt;ITS_MISHRA&gt; wrote in message&lt;BR /&gt;
news:f1344f6.-1@WebX.maYIadrTaRb...&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; My problem is that the GetObject returns the first instance&lt;BR /&gt;
&amp;gt; of the AutoCAd if the multiple instances of the AutoCAd&lt;BR /&gt;
&amp;gt; are running.&lt;BR /&gt;
&lt;BR /&gt;
This is a known limitation of GetObject and there's precious little you&lt;BR /&gt;
can do about it from the VB side. Even Autodesk's own AsdkUnsupp2000 has&lt;BR /&gt;
problems with this.&lt;BR /&gt;
&lt;BR /&gt;
My preferred solution is to create a VLX launcher. The class in question&lt;BR /&gt;
should have a public, writable Application porperty. You can then use&lt;BR /&gt;
the VLX file to create an instance of your class and set the Application&lt;BR /&gt;
property using (vlax-get-acad-object) which always returns the session&lt;BR /&gt;
in which it is called.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
There are 10 kinds of people:&lt;BR /&gt;
Those who understand binary and those who don't&lt;BR /&gt;
http://www.acadx.com&lt;/ITS_MISHRA&gt;</description>
    <pubDate>Tue, 31 Dec 2002 07:43:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-12-31T07:43:53Z</dc:date>
    <item>
      <title>Getting the Active AcadApplication</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getting-the-active-acadapplication/m-p/300916#M67181</link>
      <description>&lt;PRE&gt;I have created an activex dll containing some public methods in that. I have created an Object ARX in which I have defined the command and menu. From that Arx I am calling the public methods in the Activex dll.&lt;/PRE&gt;&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
For getting the Acad application in the dll I am using the GetObject of VB. My problem is that the GetObject returns the first instance of the AutoCAd if the multiple instances of the AutoCAd are running. Some times it happens that we have called the command from some where elae and it is running some where else. To get the solutions of this I tried to expose the application property in my dll and setting its balue from my Arx application, but when the wraper class is created it converts IAcadApplication data type in dll as structure. But when we are adding class from tlb, IAcadApplication is a class and hence conflicts is created. There is one solution to develop the whole application in C++ as object arx but that will take a lot of time and this is the reason I am developing the dlls in VB and trying to call it from an arx. So can any body help me out so that I can get the Application object of the Active acad application and not the first running ACAd application?&lt;/PRE&gt;&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance&lt;/PRE&gt;&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
&lt;BR /&gt;
Manoj&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Dec 2002 02:01:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getting-the-active-acadapplication/m-p/300916#M67181</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-12-31T02:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getting the Active AcadApplication</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getting-the-active-acadapplication/m-p/300917#M67182</link>
      <description>"manoj_vest" &lt;ITS_MISHRA&gt; wrote in message&lt;BR /&gt;
news:f1344f6.-1@WebX.maYIadrTaRb...&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; My problem is that the GetObject returns the first instance&lt;BR /&gt;
&amp;gt; of the AutoCAd if the multiple instances of the AutoCAd&lt;BR /&gt;
&amp;gt; are running.&lt;BR /&gt;
&lt;BR /&gt;
This is a known limitation of GetObject and there's precious little you&lt;BR /&gt;
can do about it from the VB side. Even Autodesk's own AsdkUnsupp2000 has&lt;BR /&gt;
problems with this.&lt;BR /&gt;
&lt;BR /&gt;
My preferred solution is to create a VLX launcher. The class in question&lt;BR /&gt;
should have a public, writable Application porperty. You can then use&lt;BR /&gt;
the VLX file to create an instance of your class and set the Application&lt;BR /&gt;
property using (vlax-get-acad-object) which always returns the session&lt;BR /&gt;
in which it is called.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
There are 10 kinds of people:&lt;BR /&gt;
Those who understand binary and those who don't&lt;BR /&gt;
http://www.acadx.com&lt;/ITS_MISHRA&gt;</description>
      <pubDate>Tue, 31 Dec 2002 07:43:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getting-the-active-acadapplication/m-p/300917#M67182</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-12-31T07:43:53Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getting-the-active-acadapplication/m-p/300918#M67183</link>
      <description>I do a similar thing in my vb.net application that finds my arx in all the processes that are running. I then can get that specific process. This is the code I am using, I don't know If you are using vb.net, but the process type is available to me in vb.net..&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Dim Proc() As Process&lt;BR /&gt;
        Dim AcadProc As Process&lt;BR /&gt;
        Proc = process.GetProcessesByName("acad")&lt;BR /&gt;
        If Proc.Length &amp;gt;= 1 Then&lt;BR /&gt;
            For Each AcadProc In Proc&lt;BR /&gt;
                Dim obj As ProcessModule&lt;BR /&gt;
                For Each obj In AcadProc.Modules&lt;BR /&gt;
&lt;BR /&gt;
                    If obj.ToString.EndsWith("(ArxNameHere.arx)") Then&lt;BR /&gt;
                        NativeAcadHandle = AcadProc.Handle&lt;BR /&gt;
                        MainAcadWindowHandle = AcadProc.MainWindowHandle()&lt;BR /&gt;
                        AcadProcess = AcadProc&lt;BR /&gt;
                    End If&lt;BR /&gt;
                Next&lt;BR /&gt;
            Next&lt;BR /&gt;
        End If&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Hope it can help you.</description>
      <pubDate>Mon, 27 Jan 2003 11:07:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getting-the-active-acadapplication/m-p/300918#M67183</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-01-27T11:07:48Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getting-the-active-acadapplication/m-p/300919#M67184</link>
      <description>I do a similar thing in my vb.net application &lt;BR /&gt;
that finds my arx in all the processes that are running. I then can get that specific process. &lt;BR /&gt;
This is the code I am using, I don't know If you are &lt;BR /&gt;
using vb.net, but the process type is available &lt;BR /&gt;
to me in vb.net.. &lt;BR /&gt;
&lt;BR /&gt;
Dim Proc() As Process &lt;BR /&gt;
Dim AcadProc As Process &lt;BR /&gt;
Proc = process.GetProcessesByName("acad") &lt;BR /&gt;
&lt;BR /&gt;
If Proc.Length &amp;gt;= 1 Then For Each AcadProc In Proc &lt;BR /&gt;
&lt;BR /&gt;
Dim obj As ProcessModule &lt;BR /&gt;
&lt;BR /&gt;
For Each obj In AcadProc.Modules &lt;BR /&gt;
&lt;BR /&gt;
If obj.ToString.EndsWith("(ArxNameHere.arx)") Then&lt;BR /&gt;
 NativeAcadHandle = AcadProc.Handle &lt;BR /&gt;
MainAcadWindowHandle = AcadProc.MainWindowHandle() &lt;BR /&gt;
AcadProcess = AcadProc &lt;BR /&gt;
End If &lt;BR /&gt;
Next &lt;BR /&gt;
Next &lt;BR /&gt;
End If &lt;BR /&gt;
&lt;BR /&gt;
Hope it can help you. (Just added some line feeds for clarity)</description>
      <pubDate>Mon, 27 Jan 2003 11:11:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getting-the-active-acadapplication/m-p/300919#M67184</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-01-27T11:11:52Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getting-the-active-acadapplication/m-p/300920#M67185</link>
      <description>Ok, sorry about the feeds</description>
      <pubDate>Mon, 27 Jan 2003 11:13:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getting-the-active-acadapplication/m-p/300920#M67185</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-01-27T11:13:19Z</dc:date>
    </item>
  </channel>
</rss>

