<?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: GetObject is not working in 2025 Beta Version in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12691072#M5978</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Marshal.GetActiveobject is only available with .NET Framework (see the bottom of &lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.marshal.getactiveobject?view=netframework-4.8.1&amp;amp;viewFallbackFrom=net-8.0" target="_blank" rel="noopener"&gt;this page&lt;/A&gt;).&lt;/P&gt;</description>
    <pubDate>Sat, 06 Apr 2024 09:50:06 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2024-04-06T09:50:06Z</dc:date>
    <item>
      <title>GetObject is not working in 2025 Beta Version</title>
      <link>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12492974#M5974</link>
      <description>&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;I need some help.&lt;/DIV&gt;&lt;DIV&gt;I've downloaded Civil 3D Vail (2025 Beta version). I've created a simple .NET 8.0 Plugin for AutoCAD 2025.&amp;nbsp;(ClassLibrary)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Here my code:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Autodesk.AutoCAD.Runtime.CommandMethod("Testgetobject")&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Public Sub Testgetobject()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim acAppComObj As Autodesk.AutoCAD.Interop.AcadApplication&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim strProgId As String = "AutoCAD.Application.25"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; acAppComObj = GetObject(, strProgId)&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If acAppComObj Is Nothing Then&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&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;MsgBox("acAppComObj is Nothing")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&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; MsgBox(acAppComObj.ActiveDocument.Name)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End if&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;End Sub&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; acAppComObj is &lt;STRONG&gt;Nothing&lt;/STRONG&gt;, &lt;STRONG&gt;GetObject is not working&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Can anyone help? Why is it not working?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Thanks.&lt;/DIV&gt;</description>
      <pubDate>Fri, 12 Jan 2024 11:47:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12492974#M5974</guid>
      <dc:creator>serpetfree</dc:creator>
      <dc:date>2024-01-12T11:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject is not working in 2025 Beta Version</title>
      <link>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12492986#M5975</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;should be placed as feedback in the beta-forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 11:55:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12492986#M5975</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2024-01-12T11:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject is not working in 2025 Beta Version</title>
      <link>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12669798#M5976</link>
      <description>&lt;P&gt;Now AutoCAD 2025 is released, I think the topic can be opened again.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;I got the same error with .Net 8, AutoCAD 2025:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;Interaction.GetObject(, "Excel.Application") &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;return Nothing&amp;nbsp;&lt;/P&gt;&lt;P&gt;As describe here for .Net 8,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;A href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.interaction.getobject?view=net-8.0" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.interaction.getobject?view=net-8.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Interaction.GetObject(, "Excel.Application")&lt;/STRONG&gt; should return an opening Excel instance (if any). In fact, it returns Nothing in all cases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there anyone got the same error?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 16:21:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12669798#M5976</guid>
      <dc:creator>ntclmain</dc:creator>
      <dc:date>2024-03-27T16:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject is not working in 2025 Beta Version</title>
      <link>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12690843#M5977</link>
      <description>&lt;P&gt;We have been using following strings in Autocad 2024 successfully.string progID = "AutoCAD.Application.24.&lt;BR /&gt;AcadApplication = (AcadApplication)Marshal.GetActiveObject(progID);&lt;BR /&gt;We have downloaded Autocad Architectural 2025 trial version. GetActiveObject is not working it is throwing an Exception.&lt;BR /&gt;If I use string progID = "AutoCAD.Application.25";&lt;BR /&gt;It throws the exception as&lt;BR /&gt;Unable to cast COM object of type 'System.__ComObject' to interface type 'AutoCAD.AcadApplication'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{52EE1CD2-A793-4DEC-9DF9-71CE75881F05}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).Please enable GetActiveObject string for 2025.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 05:08:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12690843#M5977</guid>
      <dc:creator>saviour_merlin</dc:creator>
      <dc:date>2024-04-06T05:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject is not working in 2025 Beta Version</title>
      <link>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12691072#M5978</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Marshal.GetActiveobject is only available with .NET Framework (see the bottom of &lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.marshal.getactiveobject?view=netframework-4.8.1&amp;amp;viewFallbackFrom=net-8.0" target="_blank" rel="noopener"&gt;this page&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 09:50:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12691072#M5978</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-04-06T09:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject is not working in 2025 Beta Version</title>
      <link>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12691108#M5979</link>
      <description>&lt;P&gt;Yes u r right. While I am using my WCF Service it is not working in Autocad 2025. Still Autocad 2024 it was working fine. In Autocad 2025 it is not recognizing the string.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;string progID = "AutoCAD.Application.24."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AcadApplication = (AcadApplication)Marshal.GetActiveObject(progID); It throws exception as string &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;not available&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 10:39:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12691108#M5979</guid>
      <dc:creator>saviour_merlin</dc:creator>
      <dc:date>2024-04-06T10:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject is not working in 2025 Beta Version</title>
      <link>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12691173#M5980</link>
      <description>&lt;P&gt;Just an FYI, progID &amp;nbsp;&amp;nbsp;'AutoCAD.Application.25' works from python, so its probably something wrong with .NET or your installation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def PyRxCmd_doit():
    try:
        axApp = Ax.getApp()
        print(axApp.FullName)
    except Exception as err:
        traceback.print_exception(err)

#result      
#C:\Program Files\Autodesk\AutoCAD 2025\acad.exe
        
##wrappers
#
# def getApp() -&amp;gt; IAcadApplication:
#     id = AcadApplication.CLSID
#     return win32com.client.GetActiveObject(id)
   
# # This CoClass is known by the name 'AutoCAD.Application.25'
# class AcadApplication(CoClassBaseClass): # A CoClass
#     # An instance of the AutoCAD application
#     CLSID = IID('{363E5B47-885D-44C3-89EB-A2AB2129B57E}')
#     coclass_sources = [
#         _DAcadApplicationEvents,
#     ]
#     default_source = _DAcadApplicationEvents
#     coclass_interfaces = [
#         IAcadApplication,
#     ]
#     default_interface = IAcadApplication 
    &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 11:35:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12691173#M5980</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2024-04-06T11:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject is not working in 2025 Beta Version</title>
      <link>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12691336#M5981</link>
      <description>&lt;P&gt;It seems possible to P/Invoke GetActiveObject, see &lt;A href="https://github.com/ReneNyffenegger/.NET-API/blob/master/System/Runtime/InteropServices/Marshal/GetActiveObject/PInvoke.cs" target="_blank" rel="noopener"&gt;this topic&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 14:29:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getobject-is-not-working-in-2025-beta-version/m-p/12691336#M5981</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-04-06T14:29:52Z</dc:date>
    </item>
  </channel>
</rss>

