<?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: Use .net api out of CAD process!!! in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/use-net-api-out-of-cad-process/m-p/5876393#M38207</link>
    <description>Thank you Norman.Yuan.I will try to use net to write com. To see if it is the solution for my problem.</description>
    <pubDate>Sat, 24 Oct 2015 08:57:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-10-24T08:57:44Z</dc:date>
    <item>
      <title>Use .net api out of CAD process!!!</title>
      <link>https://forums.autodesk.com/t5/net-forum/use-net-api-out-of-cad-process/m-p/5875086#M38205</link>
      <description>&lt;P&gt;&lt;!-- StartFragment  --&gt;&lt;/P&gt;&lt;DIV&gt;Hi,Guys,&lt;BR /&gt;So&amp;nbsp;far&amp;nbsp;CAD&amp;nbsp;.net&amp;nbsp;API&amp;nbsp;is&amp;nbsp;not&amp;nbsp;working&amp;nbsp;for&amp;nbsp;“out&amp;nbsp;of&amp;nbsp;process”.It's&amp;nbsp;designed&amp;nbsp;only&amp;nbsp;for&amp;nbsp;cad&amp;nbsp;command&amp;nbsp;and&amp;nbsp;we&amp;nbsp;must&amp;nbsp;keyin&amp;nbsp;command&amp;nbsp;then&amp;nbsp;wait&amp;nbsp;for&amp;nbsp;the&amp;nbsp;.net&amp;nbsp;api&amp;nbsp;functions.&lt;BR /&gt;offical&amp;nbsp;api&amp;nbsp;help&amp;nbsp;saying:&lt;BR /&gt;When&amp;nbsp;you&amp;nbsp;develop&amp;nbsp;a&amp;nbsp;new&amp;nbsp;application,&amp;nbsp;it&amp;nbsp;can&amp;nbsp;either&amp;nbsp;run&amp;nbsp;in&amp;nbsp;or&amp;nbsp;out-of-process.&amp;nbsp;The&amp;nbsp;AutoCAD&amp;nbsp;.NET&amp;nbsp;API&amp;nbsp;is&amp;nbsp;designed&amp;nbsp;to&amp;nbsp;run&amp;nbsp;in-process&amp;nbsp;only,&amp;nbsp;which&amp;nbsp;is&amp;nbsp;different&amp;nbsp;from&amp;nbsp;the&amp;nbsp;ActiveX&amp;nbsp;Automation&amp;nbsp;library&amp;nbsp;which&amp;nbsp;can&amp;nbsp;&amp;nbsp;be&amp;nbsp;used&amp;nbsp;in&amp;nbsp;or&amp;nbsp;-out-of-process.&amp;nbsp;&lt;BR /&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;In-process&amp;nbsp;applications&amp;nbsp;are&amp;nbsp;designed&amp;nbsp;to&amp;nbsp;run&amp;nbsp;in&amp;nbsp;the&amp;nbsp;same&amp;nbsp;process&amp;nbsp;space&amp;nbsp;as&amp;nbsp;the&amp;nbsp;host&amp;nbsp;application.&amp;nbsp;In&amp;nbsp;this&amp;nbsp;case,&amp;nbsp;a&amp;nbsp;DLL&amp;nbsp;assembly&amp;nbsp;is&amp;nbsp;loaded&amp;nbsp;into&amp;nbsp;AutoCAD&amp;nbsp;which&amp;nbsp;is&amp;nbsp;the&amp;nbsp;host&amp;nbsp;application.&amp;nbsp;&lt;BR /&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Out-of-process&amp;nbsp;applications&amp;nbsp;do&amp;nbsp;not&amp;nbsp;run&amp;nbsp;in&amp;nbsp;the&amp;nbsp;same&amp;nbsp;space&amp;nbsp;as&amp;nbsp;the&amp;nbsp;host&amp;nbsp;application.&amp;nbsp;These&amp;nbsp;applications&amp;nbsp;are&amp;nbsp;often&amp;nbsp;built&amp;nbsp;as&amp;nbsp;stand-alone&amp;nbsp;executables.&amp;nbsp;&lt;BR /&gt;If&amp;nbsp;you&amp;nbsp;need&amp;nbsp;to&amp;nbsp;create&amp;nbsp;a&amp;nbsp;stand-alone&amp;nbsp;application&amp;nbsp;to&amp;nbsp;drive&amp;nbsp;AutoCAD,&amp;nbsp;it&amp;nbsp;is&amp;nbsp;best&amp;nbsp;to&amp;nbsp;create&amp;nbsp;an&amp;nbsp;application&amp;nbsp;that&amp;nbsp;uses&amp;nbsp;the&amp;nbsp;CreateObject&amp;nbsp;and&amp;nbsp;GetObject&amp;nbsp;methods&amp;nbsp;to&amp;nbsp;create&amp;nbsp;a&amp;nbsp;new&amp;nbsp;instance&amp;nbsp;of&amp;nbsp;an&amp;nbsp;AutoCAD&amp;nbsp;&amp;nbsp;application&amp;nbsp;or&amp;nbsp;return&amp;nbsp;one&amp;nbsp;of&amp;nbsp;the&amp;nbsp;instances&amp;nbsp;that&amp;nbsp;is&amp;nbsp;currently&amp;nbsp;running.&amp;nbsp;Once&amp;nbsp;a&amp;nbsp;reference&amp;nbsp;to&amp;nbsp;an&amp;nbsp;AcadApplication&amp;nbsp;is&amp;nbsp;returned,&amp;nbsp;you&amp;nbsp;can&amp;nbsp;then&amp;nbsp;load&amp;nbsp;your&amp;nbsp;in-process&amp;nbsp;.NET&amp;nbsp;application&amp;nbsp;into&amp;nbsp;AutoCAD&amp;nbsp;by&amp;nbsp;using&amp;nbsp;&amp;nbsp;the&amp;nbsp;SendCommand&amp;nbsp;method&amp;nbsp;that&amp;nbsp;is&amp;nbsp;a&amp;nbsp;member&amp;nbsp;of&amp;nbsp;the&amp;nbsp;ActiveDocument&amp;nbsp;property&amp;nbsp;of&amp;nbsp;the&amp;nbsp;AcadApplication."&lt;BR /&gt;&lt;BR /&gt;Well,&amp;nbsp;Do&amp;nbsp;we&amp;nbsp;have&amp;nbsp;to&amp;nbsp;send&amp;nbsp;command&amp;nbsp;to&amp;nbsp;use&amp;nbsp;CAD&amp;nbsp;.net&amp;nbsp;api?&amp;nbsp;Is&amp;nbsp;there&amp;nbsp;any&amp;nbsp;other&amp;nbsp;ways&amp;nbsp;to&amp;nbsp;call&amp;nbsp;api&amp;nbsp;function&amp;nbsp;in&amp;nbsp;a&amp;nbsp;independent&amp;nbsp;ExE&amp;nbsp;or&amp;nbsp;dll&amp;nbsp;programm?&amp;nbsp;I&amp;nbsp;have&amp;nbsp;a&amp;nbsp;programm&amp;nbsp;which&amp;nbsp;must&amp;nbsp;be&amp;nbsp;write&amp;nbsp;out&amp;nbsp;of&amp;nbsp;CAD'&amp;nbsp;&amp;nbsp;process.&amp;nbsp;Of&amp;nbsp;course,&amp;nbsp;the&amp;nbsp;com&amp;nbsp;ActiveX&amp;nbsp;is&amp;nbsp;the&amp;nbsp;best&amp;nbsp;choice,But&amp;nbsp;its&amp;nbsp;function&amp;nbsp;is&amp;nbsp;so&amp;nbsp;limited.Such&amp;nbsp;as&amp;nbsp;DrawJig,Creating&amp;nbsp;nurbs&amp;nbsp;Curve&amp;nbsp;and&amp;nbsp;so&amp;nbsp;on.So&amp;nbsp;I&amp;nbsp;am&amp;nbsp;looking&amp;nbsp;for&amp;nbsp;a&amp;nbsp;way&amp;nbsp;to&amp;nbsp;use&amp;nbsp;CAD&amp;nbsp;.net&amp;nbsp;api&amp;nbsp;by&amp;nbsp;"out&amp;nbsp;of&amp;nbsp;process".&lt;BR /&gt;If&amp;nbsp;you&amp;nbsp;have&amp;nbsp;any&amp;nbsp;idear&amp;nbsp;about&amp;nbsp;this.&amp;nbsp;Please&amp;nbsp;advise,Thank&amp;nbsp;you&amp;nbsp;in&amp;nbsp;advance.&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Oct 2015 12:40:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/use-net-api-out-of-cad-process/m-p/5875086#M38205</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-23T12:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Use .net api out of CAD process!!!</title>
      <link>https://forums.autodesk.com/t5/net-forum/use-net-api-out-of-cad-process/m-p/5875293#M38206</link>
      <description>&lt;P&gt;While AutoCAD .NET API cannot be used DIRECTLY in "out-process", you can certainly use it INDIRECTLY, in different ways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. You can expose your .NET DLL as COM. with this option, you may run into all the potential troubles COM could result in, such as registering COM server on each running computer with admin privilege required; "dll hell", referring to version compatibility...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. You can still use COM in your EXE to drive AutoCAD and use some way to "NETLOAD" or auto-load your DLL. Then you can use COM's SemdCommand to start your custom command in .NET DLL; or you can use IExtensionApplication.Intialize() to have the process in .NET DLL started at beginning.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The decision is really depends on your business need and how you optimize your process designing. If the business process needs user interaction to some degree, using EXE to control AutoCAD is hardly a good design (as you mentioned Jig, which is meant for user interaction with AutoCAD editor, and definitely not a good candidate to be triggered from external application).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the EXE is mainly for drawing file manipulation, you may look into RealDwg, or even AutoCAD I/O, View/Data cloud services. You can also look into Acad console (local version of AutoCAD I/O/ and View/Data cloud services) being driven by your EXE.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2015 13:55:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/use-net-api-out-of-cad-process/m-p/5875293#M38206</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2015-10-23T13:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Use .net api out of CAD process!!!</title>
      <link>https://forums.autodesk.com/t5/net-forum/use-net-api-out-of-cad-process/m-p/5876393#M38207</link>
      <description>Thank you Norman.Yuan.I will try to use net to write com. To see if it is the solution for my problem.</description>
      <pubDate>Sat, 24 Oct 2015 08:57:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/use-net-api-out-of-cad-process/m-p/5876393#M38207</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-24T08:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Use .net api out of CAD process!!!</title>
      <link>https://forums.autodesk.com/t5/net-forum/use-net-api-out-of-cad-process/m-p/12269902#M38208</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running into some similar trouble. I am currently designing an application that must run out-of-process. As Norman described, I first opted for the second option: using COM interop, I start up an instance of AutoCAD from a windows forms .exe, and then use AcadApplication.SendCommand("xxx") to netload my .dll plugin and call my internal commands from there. All of these steps work great.&lt;/P&gt;&lt;P&gt;Here is my problem with this solution: I need to be able to extract data from AutoCAD to my external app. With this method, I have no way to obtain return values or call my internal dll functions. How can I establish communication in both ways?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have explored Kean's solution here:&amp;nbsp;&lt;A href="https://www.keanw.com/2009/05/interfacing-an-external-com-application-with-a-net-module-in-process-to-autocad-redux.html" target="_blank"&gt;https://www.keanw.com/2009/05/interfacing-an-external-com-application-with-a-net-module-in-process-to-autocad-redux.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Not only have I not managed to get it to work, but I believe this is the first point you were referring to by "dll hell". This is a deal breaker for me as I will deploy this application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any insights for me? Any help is greatly appreciated!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Isaac Bhérer-Constant&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 12:00:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/use-net-api-out-of-cad-process/m-p/12269902#M38208</guid>
      <dc:creator>i_bherer</dc:creator>
      <dc:date>2023-09-27T12:00:01Z</dc:date>
    </item>
  </channel>
</rss>

