<?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: Synchronize call commands in AutoCAD versions before 2015 in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238111#M1321</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16295066"&gt;@MrLi289&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I tried this method but it didn't work and the command sent was not executed&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The code&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;linked to, and the code that I posted in this thread all work, so if your attempt to use that code failed, it is an error on your part.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the code doesn't work for you, post your code that attempts to use it, otherwise we're not interested in nothing more than "didn't work".&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jan 2025 02:52:33 GMT</pubDate>
    <dc:creator>ActivistInvestor</dc:creator>
    <dc:date>2025-01-02T02:52:33Z</dc:date>
    <item>
      <title>Synchronize call commands in AutoCAD versions before 2015</title>
      <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13236052#M1312</link>
      <description>I can use the Command method of Editor to synchronously call commands in AutoCAD 2015 and above versions. However, there is no replaceable method for use in versions below 2015. May I ask if anyone has a good solution? Thanks.</description>
      <pubDate>Tue, 31 Dec 2024 09:46:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13236052#M1312</guid>
      <dc:creator>dali0312</dc:creator>
      <dc:date>2024-12-31T09:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Synchronize call commands in AutoCAD versions before 2015</title>
      <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13236079#M1313</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;There was a wrapper for the non-public RunCommand() method written by Tony Tanzillo ( &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt; or &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1052889"&gt;@DiningPhilosopher&lt;/a&gt; ) which worked the same as A2015+ Editor.Command, unfortunately this thread has been &lt;STRIKE&gt;archived&lt;/STRIKE&gt; deleted.&lt;/P&gt;
&lt;P&gt;I refound &lt;A href="http://www.theswamp.org/index.php?topic=43113.msg483306#msg483306" target="_blank" rel="noopener"&gt;an older version of this wrapper&lt;/A&gt; at TheSwamp, and the &lt;A href="http://www.theswamp.org/index.php?topic=44191.msg494502#msg494502" target="_blank" rel="noopener"&gt;"refection free" version&lt;/A&gt;, always at TheSwamp.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 10:18:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13236079#M1313</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-12-31T10:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Synchronize call commands in AutoCAD versions before 2015</title>
      <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13236087#M1314</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;has already mentioned, the code I posted here a little over 10 years ago, that solves your problem, &lt;A href="https://forums.autodesk.com/t5/net/regarding-community-content-archiving/m-p/13198106?search-action-id=1025958497373&amp;amp;search-result-uid=13198106" target="_blank" rel="noopener"&gt;has been deleted by Autodesk.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because I harbor no contempt for users of old/outdated releases of AutoCAD, Here it is again:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using System.Reflection;
using System;
using System.Linq.Expressions;

namespace Autodesk.AutoCAD.EditorInput
{
   public static class EditorInputExtensionMethods
   {
      public static PromptStatus Command(this Editor editor, params object[] args)
      {
         if(editor == null)
            throw new ArgumentNullException("editor");
         return runCommand(editor, args);
      }

      static Func&amp;lt;Editor, object[], PromptStatus&amp;gt; runCommand = Generate;

      static PromptStatus Generate(this Editor editor, params object[] arguments)
      {
         MethodInfo method = typeof(Editor).GetMethod("RunCommand",
            BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
         var instance = Expression.Parameter(typeof(Editor), "instance");
         var args = Expression.Parameter(typeof(object[]), "args");
         runCommand = Expression.Lambda&amp;lt;Func&amp;lt;Editor, object[], PromptStatus&amp;gt;&amp;gt;(
            Expression.Call(instance, method, args), instance, args)
               .Compile();
         return runCommand(editor, arguments);
      }
   }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 11:28:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13236087#M1314</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-12-31T11:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Synchronize call commands in AutoCAD versions before 2015</title>
      <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13237997#M1315</link>
      <description>&lt;P&gt;&lt;SPAN&gt;If DocumentCollection.IsApplicationContext == true, You can't use the command line or the Command() wrapper for the RunCommand method.What should I do.Is the execution order different from Command versions 15 and above&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 01:00:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13237997#M1315</guid>
      <dc:creator>MrLi289</dc:creator>
      <dc:date>2025-01-02T01:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Synchronize call commands in AutoCAD versions before 2015</title>
      <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238050#M1316</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16295066"&gt;@MrLi289&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;SPAN&gt;If DocumentCollection.IsApplicationContext == true, You can't use the command line or the Command() wrapper for the RunCommand method.What should I do.Is the execution order different from Command versions 15 and above&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In AutoCAD 2016 or later, the DocumentCollection's ExecuteInCommandContextAsync() method can be used to solve that problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ExecuteInCommandContextAsync() is&amp;nbsp;Autodesk's implementation of my original solution to that problem, that works in any AutoCAD release going back to AutoCAD 2006 or 2007 (although I never tested it with releases that old, as I originally wrote it in the AutoCAD 2012 time-frame).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That solution is discussed in &lt;A href="https://forums.autodesk.com/t5/net/overkill-on-selection-set/m-p/7683139/highlight/true#M56841" target="_blank" rel="noopener"&gt;this post&lt;/A&gt;, which also requires &lt;A href="https://forums.autodesk.com/autodesk/attachments/autodesk/152/56841/1/ContextManager.cs.txt" target="_blank" rel="noopener"&gt;this file&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 03:04:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238050#M1316</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-01-02T03:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Synchronize call commands in AutoCAD versions before 2015</title>
      <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238053#M1317</link>
      <description>&lt;P&gt;15 以下版本如何使用同步命令发送&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 02:01:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238053#M1317</guid>
      <dc:creator>MrLi289</dc:creator>
      <dc:date>2025-01-02T02:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Synchronize call commands in AutoCAD versions before 2015</title>
      <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238059#M1318</link>
      <description>&lt;P&gt;I tried this method but it didn't work and the command sent was not executed&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 02:05:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238059#M1318</guid>
      <dc:creator>MrLi289</dc:creator>
      <dc:date>2025-01-02T02:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Synchronize call commands in AutoCAD versions before 2015</title>
      <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238098#M1319</link>
      <description>&lt;P&gt;自己翻译成英文&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 02:45:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238098#M1319</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-01-02T02:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Synchronize call commands in AutoCAD versions before 2015</title>
      <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238100#M1320</link>
      <description>&lt;P&gt;How to use synchronous command to send in versions below 15&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 02:48:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238100#M1320</guid>
      <dc:creator>MrLi289</dc:creator>
      <dc:date>2025-01-02T02:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Synchronize call commands in AutoCAD versions before 2015</title>
      <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238111#M1321</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16295066"&gt;@MrLi289&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I tried this method but it didn't work and the command sent was not executed&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The code&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;linked to, and the code that I posted in this thread all work, so if your attempt to use that code failed, it is an error on your part.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the code doesn't work for you, post your code that attempts to use it, otherwise we're not interested in nothing more than "didn't work".&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 02:52:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238111#M1321</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-01-02T02:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Synchronize call commands in AutoCAD versions before 2015</title>
      <link>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238189#M1322</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16295066"&gt;@MrLi289&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;How to use synchronous command to send in versions below 15&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;See the replies above, with code and links to more code.&amp;nbsp; The code in the &lt;A href="https://forums.autodesk.com/t5/net/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13236087/highlight/true#M85088" target="_blank" rel="noopener"&gt;above post&lt;/A&gt; adds the Command() method to the Editor in versions &amp;lt; 2015.&amp;nbsp; If you add that code to your project, you can use the Command() method in versions older than 2015 in the same way you would use the built-in Command() method in later versions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't make it any simpler than that.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 04:40:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/synchronize-call-commands-in-autocad-versions-before-2015/m-p/13238189#M1322</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-01-02T04:40:27Z</dc:date>
    </item>
  </channel>
</rss>

