<?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: Override default commands in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3400541#M56458</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1026575"&gt;@annse&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I can use SendStringToExecute instead of SendCommand?&lt;/P&gt;
&lt;P&gt;This way I won't have to echo the command.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think you can do it. Try!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Apr 2012 07:39:33 GMT</pubDate>
    <dc:creator>Alexander.Rivilis</dc:creator>
    <dc:date>2012-04-05T07:39:33Z</dc:date>
    <item>
      <title>Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3398553#M56450</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Autodesk.AutoCAD.Runtime.CommandMethod("REFEDIT", Autodesk.AutoCAD.Runtime.CommandFlags.UsePickSet)]&lt;BR /&gt;public void RefEdit()&lt;BR /&gt;{&lt;BR /&gt;Document doc = AcadApp.DocumentManager.MdiActiveDocument;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (doc is a document I care about))&lt;BR /&gt;{&lt;BR /&gt;do my stuff...&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;run the default command...&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't undefined the default command,&amp;nbsp;my definition of REFEDIT executes anyway.&lt;/P&gt;&lt;P&gt;I wanna be able to run the default command from my definition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;doc.SendStringToExecute(".REFEDIT ", true, false, false); will loop forever.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2012 10:01:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3398553#M56450</guid>
      <dc:creator>annse</dc:creator>
      <dc:date>2012-04-04T10:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3398755#M56451</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried this which is very similar to what you are trying and it worked ok.&lt;/P&gt;
&lt;P&gt;With this code, the line command is redefined only for drawings that have "Test" in their name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you try this and see if it works for you ?&lt;/P&gt;
&lt;P&gt;Maybe it will then help you identify the reason for your code to loop indefinitely.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;// Add reference to Autodesk.AutoCAD.Interop 
// Add reference to Autodesk.AutoCAD.Interop.Common
using Autodesk.AutoCAD.Interop;
using Autodesk.AutoCAD.Interop.Common;

[CommandMethod("LINE")]
static public void LineMethod()
{
    Document doc = Application.DocumentManager.MdiActiveDocument;
    Editor ed = doc.Editor;
    if (doc.Name.Contains("Test"))
        ed.WriteMessage("My implementation of line");
    else
    {
        AcadApplication app = (AcadApplication)Application.AcadApplication;
        app.ActiveDocument.SendCommand("_.LINE ");
        ed.WriteMessage("My implementation of line");
    }
}
    
void IExtensionApplication.Initialize()
{
    AcadApplication app = (AcadApplication)Application.AcadApplication;
    app.ActiveDocument.SendCommand("_.UNDEFINE _LINE ");
}
&lt;/PRE&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>Wed, 04 Apr 2012 12:44:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3398755#M56451</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2012-04-04T12:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3398951#M56452</link>
      <description>&lt;P&gt;Thank you for your quick response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've added required references and I now use SendCommand instead of SendStringToExecute.&lt;/P&gt;&lt;P&gt;This will still loop indefinitely. (If doc.Name doesn't contain "Test")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public void Initialize()&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;AcadApplication app = (AcadApplication)Application.AcadApplication;&lt;BR /&gt;app.ActiveDocument.SendCommand("_.UNDEFINE _REFEDIT ");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Autodesk.AutoCAD.Runtime.CommandMethod("REFEDIT", Autodesk.AutoCAD.Runtime.CommandFlags.UsePickSet)]&lt;BR /&gt;static public void RefEdit()&lt;BR /&gt;{&lt;BR /&gt;Document doc = AcadApp.DocumentManager.MdiActiveDocument;&lt;BR /&gt;Editor ed = doc.Editor;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (doc.Name.Contains("Test"))&lt;BR /&gt;{&lt;BR /&gt;ed.WriteMessage("New refedit...");&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;AcadApplication app = (AcadApplication)Application.AcadApplication;&lt;BR /&gt;app.ActiveDocument.SendCommand("_.REFEDIT ");&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2012 13:58:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3398951#M56452</guid>
      <dc:creator>annse</dc:creator>
      <dc:date>2012-04-04T13:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3399245#M56453</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the Line command the code does work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But there seems to be some problem with using it for "Refedit".&lt;/P&gt;
&lt;P&gt;Can you check if the command is actually undefined after sending the "undefine" command ?&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>Wed, 04 Apr 2012 15:36:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3399245#M56453</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2012-04-04T15:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3399681#M56454</link>
      <description>&lt;P&gt;What about:&lt;/P&gt;
&lt;PRE&gt;app.ActiveDocument.SendCommand("_ACAD_REFEDIT.REFEDIT ");&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;?&lt;/P&gt;
&lt;P&gt;Command _REFEDIT defined in file AcRefEd.arx&lt;/P&gt;
&lt;P&gt;If your's dll-file loaded &lt;STRONG&gt;after&lt;/STRONG&gt; AcRefEd.arx - than&amp;nbsp;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;no need to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;_UNDEFINE _REFEDIT,&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;because&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;your command&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="hps"&gt;REFEDIT&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;override&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;standard command&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;REFEDIT.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;And &lt;SPAN&gt;&lt;SPAN class="hps"&gt;standard command &lt;/SPAN&gt;&lt;/SPAN&gt;REFEDIT&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;can be&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;invoked using&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;_ACAD_REFEDIT.REFEDIT&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2012 19:02:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3399681#M56454</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-04-04T19:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3400445#M56455</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I do the same thing with LINE instead of REFEDIT, my new definition of LINE won't run.&lt;/P&gt;&lt;P&gt;I get this error with both LINE and REFEDIT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;_.UNDEFINE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;; error: no function definition: ACET-STR-REPLACE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_LINE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2012 06:32:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3400445#M56455</guid>
      <dc:creator>annse</dc:creator>
      <dc:date>2012-04-05T06:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3400463#M56456</link>
      <description>&lt;P&gt;Thanks, Alexander! That works!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My dll is loaded in a .bundle installation.&lt;/P&gt;&lt;P&gt;So, because I can't override _LINE the same way, _LINE is loaded after my dll and _REFEDIT before?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2012 06:46:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3400463#M56456</guid>
      <dc:creator>annse</dc:creator>
      <dc:date>2012-04-05T06:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3400525#M56457</link>
      <description>&lt;P&gt;If the timing issue is irrelevant due to that the _REFEDIT command is already defined when my dll is loading,&lt;/P&gt;&lt;P&gt;I can use SendStringToExecute instead of SendCommand?&lt;/P&gt;&lt;P&gt;This way I won't have to echo the command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2012 07:29:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3400525#M56457</guid>
      <dc:creator>annse</dc:creator>
      <dc:date>2012-04-05T07:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3400541#M56458</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1026575"&gt;@annse&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I can use SendStringToExecute instead of SendCommand?&lt;/P&gt;
&lt;P&gt;This way I won't have to echo the command.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think you can do it. Try!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2012 07:39:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3400541#M56458</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-04-05T07:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3400755#M56459</link>
      <description>&lt;P&gt;Hello again...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sending&amp;nbsp;&lt;SPAN&gt;"_ACAD_REFEDIT.REFEDIT " seems to redefine the command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the string is executed, the next time you run REFEDIT, it'll run the default definition.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Autodesk.AutoCAD.Runtime.CommandMethod("REFEDIT", Autodesk.AutoCAD.Runtime.CommandFlags.Session &amp;amp; Autodesk.AutoCAD.Runtime.CommandFlags.UsePickSet)]&lt;BR /&gt;static public void RefEditDef()&lt;BR /&gt;{&lt;BR /&gt;Document doc = Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;Editor ed = doc.Editor;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (doc.Name.Contains("Test"))&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ed.WriteMessage("selected ref..");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;doc.SendStringToExecute("_ACAD_REFEDIT.REFEDIT ", true, false, false);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2012 10:32:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3400755#M56459</guid>
      <dc:creator>annse</dc:creator>
      <dc:date>2012-04-05T10:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3401049#M56460</link>
      <description>&lt;DIV id="gt-res-content" class="almost_half_cell"&gt;
&lt;DIV dir="ltr"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;The reason is&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;that, in&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;fact,&lt;/SPAN&gt; AutoCAD &lt;SPAN class="hps atn"&gt;arx-&lt;/SPAN&gt;&lt;SPAN&gt;application, that handles&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;command&lt;/SPAN&gt; &lt;SPAN class="hps atn"&gt;_REFEDIT (&lt;/SPAN&gt;&lt;SPAN&gt;ie&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;AcRefEd.arx)&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is loaded&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;when you first run&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the command&lt;/SPAN&gt; &lt;SPAN class="hps alt-edited"&gt;and overrides&lt;/SPAN&gt; &lt;SPAN&gt;&lt;SPAN class="hps alt-edited"&gt;your command &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="hps"&gt;REFEDIT&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;Therefore,&lt;/SPAN&gt; &lt;SPAN class="hps alt-edited"&gt;need to load&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;AcRefEd.arx &lt;STRONG&gt;before&lt;/STRONG&gt; your's dll-file will be loaded:&lt;/SPAN&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;PRE&gt;Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLinker.LoadModule ("AcRefEd.arx", false,true);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Also you can modify registry to &lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;AcRefEd.arx will loaded with AutoCAD startup:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R&lt;STRONG&gt;&lt;FONT color="#000080"&gt;XX.X&lt;/FONT&gt;&lt;/STRONG&gt;\ACAD-&lt;STRONG&gt;&lt;FONT color="#000080"&gt;AYYY:ZZZ&lt;/FONT&gt;&lt;/STRONG&gt;\Applications\AcadRefEdit
LOADCTRLS = &lt;STRONG&gt;0x02&lt;/STRONG&gt; (instead of &lt;STRONG&gt;0x0d&lt;/STRONG&gt;)

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 05 Apr 2012 13:26:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3401049#M56460</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-04-05T13:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3401229#M56461</link>
      <description>&lt;P&gt;I've modified the registry. Even if I undefine _REFEDIT, m&lt;SPAN&gt;y definition doesn't get called.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2012 14:49:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3401229#M56461</guid>
      <dc:creator>annse</dc:creator>
      <dc:date>2012-04-05T14:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3402455#M56462</link>
      <description>&lt;DIV style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;P style="margin: 0px;"&gt;This code was tested with AutoCAD 2011-2013:&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&lt;SPAN style="color: blue;"&gt;using&lt;/SPAN&gt; &lt;SPAN style="color: #020002;"&gt;System&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&lt;SPAN style="color: blue;"&gt;using&lt;/SPAN&gt; &lt;SPAN style="color: #020002;"&gt;Autodesk&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;AutoCAD&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;Runtime&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&lt;SPAN style="color: blue;"&gt;using&lt;/SPAN&gt; &lt;SPAN style="color: #020002;"&gt;Autodesk&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;AutoCAD&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;ApplicationServices&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&lt;SPAN style="color: blue;"&gt;using&lt;/SPAN&gt; &lt;SPAN style="color: #020002;"&gt;Autodesk&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;AutoCAD&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;EditorInput&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;[&lt;SPAN style="color: blue;"&gt;assembly&lt;/SPAN&gt;: &lt;SPAN style="color: #2b91af;"&gt;ExtensionApplication&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="color: #020002;"&gt;Rivilis&lt;/SPAN&gt;.&lt;SPAN style="color: #2b91af;"&gt;RefEditSubst&lt;/SPAN&gt;))]&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;[&lt;SPAN style="color: blue;"&gt;assembly&lt;/SPAN&gt;: &lt;SPAN style="color: #2b91af;"&gt;CommandClass&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="color: #020002;"&gt;Rivilis&lt;/SPAN&gt;.&lt;SPAN style="color: #2b91af;"&gt;RefEditSubst&lt;/SPAN&gt;))]&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&lt;SPAN style="color: blue;"&gt;namespace&lt;/SPAN&gt; &lt;SPAN style="color: #020002;"&gt;Rivilis&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;{&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;SPAN style="color: blue;"&gt;public&lt;/SPAN&gt; &lt;SPAN style="color: blue;"&gt;class&lt;/SPAN&gt; &lt;SPAN style="color: #2b91af;"&gt;RefEditSubst&lt;/SPAN&gt; : &lt;SPAN style="color: #2b91af;"&gt;IExtensionApplication&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: blue;"&gt;void&lt;/SPAN&gt; &lt;SPAN style="color: #2b91af;"&gt;IExtensionApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;Initialize&lt;/SPAN&gt;()&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: green;"&gt;// Preloading AutoCAD RefEdit command arx-file&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: #2b91af;"&gt;SystemObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;DynamicLinker&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;LoadModule&lt;/SPAN&gt;(&lt;SPAN style="color: #a31515;"&gt;"AcRefEd.arx"&lt;/SPAN&gt;, &lt;SPAN style="color: blue;"&gt;false&lt;/SPAN&gt;, &lt;SPAN style="color: blue;"&gt;false&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: blue;"&gt;void&lt;/SPAN&gt; &lt;SPAN style="color: #2b91af;"&gt;IExtensionApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;Terminate&lt;/SPAN&gt;()&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: green;"&gt;// Do plug-in application clean up here&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: green;"&gt;//------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: green;"&gt;//&amp;nbsp; &amp;nbsp;&amp;nbsp; Command group MUST be "ACAD_MAIN"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: green;"&gt;//------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&lt;SPAN style="color: #2b91af;"&gt;CommandMethod&lt;/SPAN&gt;(&lt;SPAN style="color: #a31515;"&gt;"ACAD_MAIN"&lt;/SPAN&gt;, &lt;SPAN style="color: #a31515;"&gt;"RefEdit"&lt;/SPAN&gt;, &lt;SPAN style="color: #2b91af;"&gt;CommandFlags&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;UsePickSet&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: blue;"&gt;public&lt;/SPAN&gt; &lt;SPAN style="color: blue;"&gt;void&lt;/SPAN&gt; &lt;SPAN style="color: #020002;"&gt;RefEdit&lt;/SPAN&gt;() &lt;SPAN style="color: green;"&gt;// This method can have any name&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: #2b91af;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #020002;"&gt;doc&lt;/SPAN&gt; = &lt;SPAN style="color: #2b91af;"&gt;Application&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;DocumentManager&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;MdiActiveDocument&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: #2b91af;"&gt;Editor&lt;/SPAN&gt; &lt;SPAN style="color: #020002;"&gt;ed&lt;/SPAN&gt; = &lt;SPAN style="color: #020002;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;Editor&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: #020002;"&gt;ed&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;WriteMessage&lt;/SPAN&gt;(&lt;SPAN style="color: #a31515;"&gt;"MyRefEdit.."&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: blue;"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="color: #020002;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;Name&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #a31515;"&gt;"Test"&lt;/SPAN&gt;))&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: #020002;"&gt;ed&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;WriteMessage&lt;/SPAN&gt;(&lt;SPAN style="color: #a31515;"&gt;"selected ref.."&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: blue;"&gt;else&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN style="color: #020002;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #020002;"&gt;SendStringToExecute&lt;/SPAN&gt;(&lt;SPAN style="color: #a31515;"&gt;"_ACAD_REFEDIT.REFEDIT "&lt;/SPAN&gt;, &lt;SPAN style="color: blue;"&gt;true&lt;/SPAN&gt;, &lt;SPAN style="color: blue;"&gt;false&lt;/SPAN&gt;, &lt;SPAN style="color: blue;"&gt;false&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P style="margin: 0px;"&gt;}&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Apr 2012 10:46:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3402455#M56462</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-04-06T10:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3402505#M56463</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very nice solution Alexander !!&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2012 11:37:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3402505#M56463</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2012-04-06T11:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3402509#M56464</link>
      <description>&lt;P&gt;Thanks! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2012 11:41:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3402509#M56464</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-04-06T11:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3406095#M56465</link>
      <description>&lt;P&gt;Thank you, Alexander! Setting the command group did it.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 08:02:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3406095#M56465</guid>
      <dc:creator>annse</dc:creator>
      <dc:date>2012-04-10T08:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3406109#M56466</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1026575"&gt;@annse&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you, Alexander! Setting the command group did it.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What about accept solution: &lt;A href="http://forums.autodesk.com/t5/FAQ-How-To-Using-Autodesk/Accepted-Solutions/td-p/2701533" target="_blank"&gt;http://forums.autodesk.com/t5/FAQ-How-To-Using-Autodesk/Accepted-Solutions/td-p/2701533&lt;/A&gt; ?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 08:07:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3406109#M56466</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-04-10T08:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Override default commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3406123#M56467</link>
      <description>&lt;P&gt;Accepted. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 08:12:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/override-default-commands/m-p/3406123#M56467</guid>
      <dc:creator>annse</dc:creator>
      <dc:date>2012-04-10T08:12:15Z</dc:date>
    </item>
  </channel>
</rss>

