<?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: Is there anyway to call AutoCAD/ Civil 3D command from .Net? in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/is-there-anyway-to-call-autocad-civil-3d-command-from-net/m-p/13153774#M1036</link>
    <description>&lt;P&gt;Besides .NET API's SendStringToExecute() and COM API's SendCommand(), there is also Editor.Command()/Editor.CommandAsync() one can use to execute a built-in command. Unlike SendStringToExeute()/SendCommand() that run asyncly, Editor.Command() runs synchronously (but only in CommandContext).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, not all built-in AutoCAD commands, especially C3D commands, have command-line version, and those commands would call up UI/dialog box, which would hold up the execution and wait for user interaction.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, in general, the simple answer to your question is, yes, your execute commands from .NET API code, but many commands would not be able to continue/finish if the commands do not have a pure command-line version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 23:21:08 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2024-11-15T23:21:08Z</dc:date>
    <item>
      <title>Is there anyway to call AutoCAD/ Civil 3D command from .Net?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/is-there-anyway-to-call-autocad-civil-3d-command-from-net/m-p/13147725#M1033</link>
      <description>&lt;P&gt;Not all&amp;nbsp;AutoCAD/ Civil 3D command are easily discovered in the API doc. But assuming that I'm already familiar with AutoCAD/Civil 3D command at the command line, is there anyway that I can call them directly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I want to call `_AECCSETNETWORKCATALOG`. How can I do it?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 10:06:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/is-there-anyway-to-call-autocad-civil-3d-command-from-net/m-p/13147725#M1033</guid>
      <dc:creator>soonhui</dc:creator>
      <dc:date>2024-11-13T10:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is there anyway to call AutoCAD/ Civil 3D command from .Net?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/is-there-anyway-to-call-autocad-civil-3d-command-from-net/m-p/13147962#M1034</link>
      <description>&lt;P&gt;&lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_ApplicationServices_Document_SendStringToExecute_string__MarshalAsUnmanagedType_U1__bool__MarshalAsUnmanagedType_U1__bool__MarshalAsUnmanagedType_U1__bool" target="_blank" rel="noopener"&gt;SendStringToExecute &lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 12:31:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/is-there-anyway-to-call-autocad-civil-3d-command-from-net/m-p/13147962#M1034</guid>
      <dc:creator>sybold</dc:creator>
      <dc:date>2024-11-13T12:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is there anyway to call AutoCAD/ Civil 3D command from .Net?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/is-there-anyway-to-call-autocad-civil-3d-command-from-net/m-p/13148743#M1035</link>
      <description>&lt;P&gt;You can also use the SendCommand method of the AcadDocument.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=GUID-E13A580D-04CA-46C1-B807-95BB461A0A57" target="_blank"&gt;AutoCAD 2025 Developer and ObjectARX Help | SendCommand Method (ActiveX) | Autodesk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will need to keep in mind that there are differences in how the different methods get executed,&amp;nbsp;&lt;SPAN&gt;asynchronous&amp;nbsp;vs&amp;nbsp;synchronously. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I ran tests using the _AECCSETNETWORKCATALOG command. At the end of my .NET code, I print to the command line using editor.WriteMessage. That message appears on the commandline while the dialog box for the _AeccSetNetworkCatalog is still up and active. That's my two cents.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is another link on the topic.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://help.autodesk.com/view/OARX/2022/ENU/?guid=GUID-F4A36181-39FB-4923-A2AF-3333945DB289" target="_blank"&gt;AutoCAD 2022 Developer and ObjectARX Help | Access the Command Line (.NET) | Autodesk&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 19:27:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/is-there-anyway-to-call-autocad-civil-3d-command-from-net/m-p/13148743#M1035</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2024-11-13T19:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is there anyway to call AutoCAD/ Civil 3D command from .Net?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/is-there-anyway-to-call-autocad-civil-3d-command-from-net/m-p/13153774#M1036</link>
      <description>&lt;P&gt;Besides .NET API's SendStringToExecute() and COM API's SendCommand(), there is also Editor.Command()/Editor.CommandAsync() one can use to execute a built-in command. Unlike SendStringToExeute()/SendCommand() that run asyncly, Editor.Command() runs synchronously (but only in CommandContext).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, not all built-in AutoCAD commands, especially C3D commands, have command-line version, and those commands would call up UI/dialog box, which would hold up the execution and wait for user interaction.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, in general, the simple answer to your question is, yes, your execute commands from .NET API code, but many commands would not be able to continue/finish if the commands do not have a pure command-line version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:21:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/is-there-anyway-to-call-autocad-civil-3d-command-from-net/m-p/13153774#M1036</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2024-11-15T23:21:08Z</dc:date>
    </item>
  </channel>
</rss>

