<?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: Trouble connecting to ACAD with VB.NET in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/trouble-connecting-to-acad-with-vb-net/m-p/7801719#M27224</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;What is the point of it if it cannot be used from an exe app?&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;You CANNOT use AutoCAD .NET API assenblies (accoremgd/acdbmgd/acmgd.dll) in stand-alone EXE app.&lt;/P&gt;&lt;P class="1519314436629"&gt;...&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;What is the point/purpose if it cannot be used in an exe?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The point/purpose is that it (the .NET API) can be used to build &lt;STRONG&gt;&lt;EM&gt;extensions&lt;/EM&gt; &lt;/STRONG&gt;that AutoCAD loads into its own .exe process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Extensions take the form of a windows dynamic link library (.dll), and AutoCAD loads those extension DLLs into its process, and the extensions are free from the limitations of the ActiveX/COM object model used by VBA and all external (.e.g. "exe") automation clients. Extensions (*.dll) can do many things that aren't possible with the ActiveX/COM API. They can define new commands, for example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Feb 2018 00:19:32 GMT</pubDate>
    <dc:creator>ActivistInvestor</dc:creator>
    <dc:date>2018-02-23T00:19:32Z</dc:date>
    <item>
      <title>Trouble connecting to ACAD with VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/trouble-connecting-to-acad-with-vb-net/m-p/7799452#M27220</link>
      <description>&lt;P&gt;I have an existing EXE program in VS 2017, and I want to add the capacity to create a polyline in Autocad 2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usually, I would use VBA, but now I need to use VB.NET, because my exe is in vb.net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm confused. Should I use &lt;SPAN&gt;ObjectARX SDK&lt;/SPAN&gt;? Is compatible with VS 2017? or should I keep the COM interfaces?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I installed&amp;nbsp;&lt;SPAN&gt;ObjectARX, and it copied&amp;nbsp;AcCoreMgd, AcDbMgd And AcMgd dlls to the autocad folder, but it decompressed&amp;nbsp;files in C:\Autodesk\Autodesk_ObjectARX_2018_Win_64_and_32_Bit&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can I delete the folder C:\Autodesk\Autodesk_ObjectARX_2018_Win_64_and_32_Bit?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried this code to connect to autocad&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(I added the references to&amp;nbsp;AcCoreMgd, AcDbMgd And AcMgd dlls)&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry

Module ModuleAutocad
    Public AutocadApp As Document
    Public AutocadDatabase As Database

    Public Sub ConnectToAutocad()
        ' Get the current document and database
        AutocadApp  = Application.DocumentManager.MdiActiveDocument
        AutocadDatabase  = AutocadApp.Database
    End Sub
End Module&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;but it causes this error:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;System.IO.FileNotFoundException: 'Could not load file or assembly 'accoremgd, Version=22.0.0.0,&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Feb 2018 13:31:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trouble-connecting-to-acad-with-vb-net/m-p/7799452#M27220</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-22T13:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble connecting to ACAD with VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/trouble-connecting-to-acad-with-vb-net/m-p/7799706#M27221</link>
      <description>&lt;P&gt;You CANNOT use AutoCAD .NET API assenblies (accoremgd/acdbmgd/acmgd.dll) in stand-alone EXE app. If you have to use external EXE to automate AutoCAD, you use AutoCAD's COM API, much similar to what you do in AutoCAD VBA, except your code is resposible to create/get AcadApplication/AcadDocument object that your code works against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To use AutoCAD COM API with .NET development tool (VB.NET/C#), unless you use late binding, in the EXE project you set reference to AutoCAD tyle library and acad objectDBX common library in 2 ways:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. if you downloaded AutoCAD ObjectARX SDK, you set reference to Autodesk.AutoCAD.Interop.dll and Autodesk.AutoCAD.Interop.common.dll coming in the SDK. Or you can set reeferences to these 2 files in AutoCAD installation folder. Make sure to set "Embed interop types" and "Copy Local" to false.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Or, you can open "add reference" dialog box, select "COM" tab, in the availabel COM library list, select "AutoCAD 20xx Type Library" and "AutoCAD/ObjectDBX Common 2x.x Type Libarary". After you click OK, VS will generate .NET wrapper assemblies (AutoCAD.Interop.dll and AXDBLib.dll). Make sure for these 2 DLLs "Copy Local" are set to "True"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, if you know AutoCAD COM API very well (object names, available methods...), you can use late binding without adding references to COM API type library at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see, ObjectARX SDK is not required at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, you do not "install" AutoCAD ObjectARX SDK. When you run the downloaded SDK EXE, the exe is simply an self-compressed EXE. When "run" it, it only extract all the filed of the SDK to a given location, default to "C:\Autodesk\AutoCAD_ObjectARX_20xx...." nothing really installed (for execution). So, yes, you can delete the folder, or move it to anywhere you choose.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 14:26:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trouble-connecting-to-acad-with-vb-net/m-p/7799706#M27221</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2018-02-22T14:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble connecting to ACAD with VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/trouble-connecting-to-acad-with-vb-net/m-p/7800088#M27222</link>
      <description>&lt;P&gt;What is the point of it if it cannot be used from an exe app?&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;You CANNOT use AutoCAD .NET API assenblies (accoremgd/acdbmgd/acmgd.dll) in stand-alone EXE app.&lt;/P&gt;&lt;P class="1519314436629"&gt;...&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;What is the point/purpose if it cannot be used in an exe?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 15:48:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trouble-connecting-to-acad-with-vb-net/m-p/7800088#M27222</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-22T15:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble connecting to ACAD with VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/trouble-connecting-to-acad-with-vb-net/m-p/7800250#M27223</link>
      <description>&lt;P&gt;Using external EXE to automate/control super-heavy desktop application AutoCAD is rarely an good solution. Most AutoCAD customizations run in-process (inside AutoCAD). .NET API is more powerful than VBA (COM API), and can also work mixed with COM API. At one point VBA was thought completely dead and would be gone; and only survived when MS finnaly licenced out VBA7 64-bit. But no one should invest seriously into AutoCAD VBA thiese days any more. Thus the point of using .NET API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are convinced that your external EXE automating AutoCAD is best solution (again, I doubt in most cases), you have to stick with COM API (or, make your .NET API code COM-able, if you do not mind the pains-taking work).&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 16:25:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trouble-connecting-to-acad-with-vb-net/m-p/7800250#M27223</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2018-02-22T16:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble connecting to ACAD with VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/trouble-connecting-to-acad-with-vb-net/m-p/7801719#M27224</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;What is the point of it if it cannot be used from an exe app?&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;You CANNOT use AutoCAD .NET API assenblies (accoremgd/acdbmgd/acmgd.dll) in stand-alone EXE app.&lt;/P&gt;&lt;P class="1519314436629"&gt;...&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;What is the point/purpose if it cannot be used in an exe?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The point/purpose is that it (the .NET API) can be used to build &lt;STRONG&gt;&lt;EM&gt;extensions&lt;/EM&gt; &lt;/STRONG&gt;that AutoCAD loads into its own .exe process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Extensions take the form of a windows dynamic link library (.dll), and AutoCAD loads those extension DLLs into its process, and the extensions are free from the limitations of the ActiveX/COM object model used by VBA and all external (.e.g. "exe") automation clients. Extensions (*.dll) can do many things that aren't possible with the ActiveX/COM API. They can define new commands, for example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 00:19:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trouble-connecting-to-acad-with-vb-net/m-p/7801719#M27224</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2018-02-23T00:19:32Z</dc:date>
    </item>
  </channel>
</rss>

