<?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: CommandManager.ActiveCommand is not set with my command in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8840755#M75457</link>
    <description>&lt;P&gt;What is the window you show that displays the running commands? Is that an inventor tool?&lt;/P&gt;</description>
    <pubDate>Sun, 09 Jun 2019 02:09:45 GMT</pubDate>
    <dc:creator>NachoShaw</dc:creator>
    <dc:date>2019-06-09T02:09:45Z</dc:date>
    <item>
      <title>CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8819958#M75448</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see two pictures below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Built In Command" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/641665i556D24FEAC391FF4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BuiltInCommand.PNG" alt="Built In Command" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Built In Command&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="My Command" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/641666iCCCB38A01C844F1F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MyCommand.PNG" alt="My Command" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;My Command&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I execute a built in command, the internal name of the command will be set to ActiveCommand.&lt;/P&gt;&lt;P&gt;But with executing my command that is created by C#, the name is not set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to get a name when OnExecute was just called.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public override void ControlEvents_OnExecute(NameValueMap options)
{
    System.Diagnostics.Debug.WriteLine("ActiveCommand : " + InventorApplication.CommandManager.ActiveCommand);&lt;/PRE&gt;&lt;P&gt;This caused...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ActiveCommand : AppSelectNorthwestArrowCmd&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I set my command name to CommandManager.ActiveCommand?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 01:16:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8819958#M75448</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-05-29T01:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8820241#M75449</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/555733"&gt;@HideoYamada&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hoping that suggestions in the below blog link may be helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html" target="_blank"&gt;https://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 06:32:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8820241#M75449</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-05-29T06:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8822995#M75450</link>
      <description>&lt;P&gt;Hello chandra,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Hoping that suggestions in the below blog link may be helpful.&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html" target="_blank" rel="noopener"&gt;https://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Unfortunately that was not the answer for me.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've written a simple test code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public class StandardAddInServer : Inventor.ApplicationAddInServer
{
    private Inventor.Application m_inventorApplication;
    ButtonDefinition definition; 
    public StandardAddInServer() {}
    public void Activate(Inventor.ApplicationAddInSite addInSiteObject, bool firstTime)
    {
        m_inventorApplication = addInSiteObject.Application;
        definition = m_inventorApplication.CommandManager.ControlDefinitions.AddButtonDefinition("ActiveCommandTest", "ActiveCommandTest", CommandTypesEnum.kShapeEditCmdType, "MyClientID");
        definition.OnExecute += Definition_OnExecute;
    }
    private void Definition_OnExecute(NameValueMap Context)
    {
        MessageBox.Show("ActiveCommand : " + m_inventorApplication.CommandManager.ActiveCommand);
    }
    public void Deactivate()
    {
        definition.OnExecute -= Definition_OnExecute;
        m_inventorApplication = null;
        GC.Collect();
        GC.WaitForPendingFinalizers();
    }
    public void ExecuteCommand(int commandID) {}
    public object Automation
    {
        get { return null; }
    }
}&lt;/PRE&gt;&lt;P&gt;The MessageBox always says 'AppSelectNorthwestArrowCmd'.&lt;/P&gt;&lt;P&gt;It was tested with Inventor 2019 and 2020.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know what happens (or not)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradica&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 08:12:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8822995#M75450</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-05-30T08:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8831197#M75451</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/555733"&gt;@HideoYamada&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please provide non confidential code and reproducible steps to test the behavior?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 11:14:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8831197#M75451</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-06-04T11:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8832849#M75452</link>
      <description>&lt;P&gt;Hello Chandra,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached the project archive of the test code.&lt;/P&gt;&lt;P&gt;Open a part document and execute this command, and then you can see the dialog of ActiveCommand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code and results are the same as described in my last post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 00:17:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8832849#M75452</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-06-05T00:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8838669#M75453</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/555733"&gt;@HideoYamada&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On successful execution of source code, where is "ActiveCommandTest" button created?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 12:25:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8838669#M75453</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-06-07T12:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8838918#M75454</link>
      <description>&lt;P&gt;Hello Chandra,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;On successful execution of source code, where is "ActiveCommandTest" button created?&lt;/BLOCKQUOTE&gt;&lt;P&gt;No button will be created.&lt;/P&gt;&lt;P&gt;Please assign "ActiveCommandTest" to a key.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ActiveCommandTest.PNG" style="width: 844px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/645183iAA2C6932A1D69DAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="ActiveCommandTest.PNG" alt="ActiveCommandTest.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's better to open a document file before doing the test, because sometime invoking command by the key is ignored when it is in the ZeroDoc environment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 14:09:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8838918#M75454</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-06-07T14:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8839819#M75455</link>
      <description>&lt;P&gt;If you're in the OnExecute handler for your command, you already know what the command is.&amp;nbsp; What do you need ActiveCommand for?&amp;nbsp; Just for reference, Inventor reports the ActiveCommand as the default command for my custom commands as well.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 21:28:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8839819#M75455</guid>
      <dc:creator>jjstr8</dc:creator>
      <dc:date>2019-06-07T21:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8839972#M75456</link>
      <description>&lt;P&gt;Hello jjstr8,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to know other command is already running or not when my command is executed.&lt;/P&gt;&lt;P&gt;Build-in commands sets their names to ActiveCommand and I can do proper processing&lt;/P&gt;&lt;P&gt;(e.g. cancel this execution, terminate the running command)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But my commands cannot know other command I made is running or not.&lt;/P&gt;&lt;P&gt;This is the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 01:34:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8839972#M75456</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-06-08T01:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8840755#M75457</link>
      <description>&lt;P&gt;What is the window you show that displays the running commands? Is that an inventor tool?&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2019 02:09:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8840755#M75457</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2019-06-09T02:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8841017#M75458</link>
      <description>&lt;P&gt;Hello NachoUK,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1262283"&gt;@NachoShaw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;What is the window you show that displays the running commands? Is that an inventor tool?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only I want to do is knowing another command is running or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CommandIsExecuting.PNG.jpg" style="width: 947px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/645528iE8740559402ECBD0/image-size/large?v=v2&amp;amp;px=999" role="button" title="CommandIsExecuting.PNG.jpg" alt="CommandIsExecuting.PNG.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If another standard Inventor command is executed in this situation, already running command (Extrude) will be canceled and then new command will be executed.&lt;/P&gt;&lt;P&gt;When my command is executed in this situation, my command runs with another command (Extrude) running. (and this will make Inventor crash)&lt;/P&gt;&lt;P&gt;So I want know command is already running or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is said same thing when my command is running first. I think that my commands must tell they are running or not via CommandManager.ActiveCommand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or, is there a way to execute command as modal?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2019 12:31:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8841017#M75458</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-06-09T12:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8842469#M75459</link>
      <description>&lt;P&gt;Hideo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As best I can tell, only built-in commands report through ActiveCommand.&amp;nbsp; In your last post you asked about running a custom command as modal.&amp;nbsp; In your OnExecute method, use ShowDialog() instead of Show().&amp;nbsp; If there are cases that this doesn't work for you, I've tested another way for custom commands in a single addin to close each other.&amp;nbsp; Let me know if you want the details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 15:08:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8842469#M75459</guid>
      <dc:creator>jjstr8</dc:creator>
      <dc:date>2019-06-10T15:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8843459#M75460</link>
      <description>&lt;P&gt;Hello jjstr8,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;As best I can tell, only built-in commands report through ActiveCommand.&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Ah, It's a bad news for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;In your last post you asked about running a custom command as modal.&amp;nbsp; In your OnExecute method, use ShowDialog() instead of Show().&amp;nbsp; If there are cases that this doesn't work for you, I've tested another way for custom commands in a single addin to close each other.&amp;nbsp; Let me know if you want the details.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Some of my commands have no Window forms. (but FileDialog and UserInteractionEvents)&lt;/P&gt;&lt;P&gt;I can tell to my commands that the others I made are running or not, but still my commands can't know about the add-in which is made by someone else.&lt;/P&gt;&lt;P&gt;I am publishing my commands at App Store. I want to tell to someone's add-in at least about state of my commands.&lt;/P&gt;&lt;P&gt;(To avoid someone's add-in making Inventor crash while my commands are running.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it seems that there is no way...&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 00:12:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8843459#M75460</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-06-11T00:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8843719#M75461</link>
      <description>&lt;P&gt;The reason you're not seeing your command as the active command is that you haven't created a command.&amp;nbsp; You've created a button definition, added a control to the ribbon, and are listening for the OnExecute event.&amp;nbsp; This doesn't result in a command being run, but only in notifying you that a button was clicked.&amp;nbsp; You should see that whatever the active command is when you click the button, remains active.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create a real command you need to do what you're doing but in the OnExecute event you need to create an InteractionEvents object and start it.&amp;nbsp; This is what actually starts your custom command.&amp;nbsp; Doing this will terminate the currently running command and you'll now have primary access to all of the user events.&amp;nbsp; In addition, your command will be returned as the active command.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 06:07:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8843719#M75461</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2019-06-11T06:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8846151#M75462</link>
      <description>&lt;P&gt;Hello BrianEkins,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for replying.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;gt; To create a real command you need to do what you're doing but in the OnExecute event you need to create an InteractionEvents object and start it.&lt;/P&gt;&lt;P&gt;(omission)&lt;/P&gt;&lt;P&gt;&amp;gt; In addition, your command will be returned as the active command.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please see the first post on this thread.&lt;/P&gt;&lt;P&gt;When an InteractionEvents starts then pre-executed command will be terminated as you said.&lt;/P&gt;&lt;P&gt;However, ActiveCommand is set to 'InteractionEvents' (not my command name).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And executing the standard Derived Part command cause opening file dialog and closing pre-exexuted command.&lt;BR /&gt;(There is no InteractionEvents!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a lack of API functionality?&lt;BR /&gt;Now I think so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 03:31:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8846151#M75462</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-06-12T03:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8847615#M75463</link>
      <description>&lt;P&gt;Hideo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like you need to set the command name through the InteractionEvents object you created.&amp;nbsp; I'm not sure where you're doing this in your code, but it can be done in your command's class constructor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public partial class MyCommandForm : Form
{
     private Inventor.Application inventorApp;
     private Inventor.InteractionEvents interactionEvents;

     public MyCommandForm(Inventor.Application app)
     {
           inventorApp = app;
           interactionEvents = inventorApp.CommandManager.CreateInterationEvents();
           interactionEvents.Name = "MyCustomCommand";
           interactionEvents.Start();
     }
     private void MyCommandForm_FormClosing(object sender, FormClosingEventArgs e)
      {
            interactionEvents.Stop();
      }
}&lt;/PRE&gt;&lt;P&gt;This is just an example.&amp;nbsp; I don't know if it fits your needs exactly.&amp;nbsp; Any "start" of another interaction events object will overwrite ActiveCommand (either with the .Name of the new one or "InteractionEvents" if .Name == "").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 16:15:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8847615#M75463</guid>
      <dc:creator>jjstr8</dc:creator>
      <dc:date>2019-06-12T16:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8847650#M75464</link>
      <description>&lt;P&gt;I think what NachoUK is asking is what is the window in your original post with the green title bar?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 16:21:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8847650#M75464</guid>
      <dc:creator>jjstr8</dc:creator>
      <dc:date>2019-06-12T16:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8848527#M75465</link>
      <description>&lt;P&gt;Hello jjstr8,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ActiveCommand could be set as you said. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 00:39:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8848527#M75465</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-06-13T00:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8848546#M75466</link>
      <description>&lt;P&gt;&amp;gt; I think what NachoUK is asking is what is the window in your original post with the green title bar?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the advice, jjstr8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The window with the green title bar is the watch window of VBA.&lt;/P&gt;&lt;P&gt;(I should have run the English version, sorry &amp;gt; all)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 00:54:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8848546#M75466</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-06-13T00:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: CommandManager.ActiveCommand is not set with my command</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8848561#M75467</link>
      <description>&lt;P&gt;Thanks a lot all of you!! I got a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;&amp;lt;Conclusions&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;(1) CommandManager.ActiveCommand can be changed by starting InteractionEvents.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(2) InteractionEvents.Start() will stop the command already executed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(3) Every command that will make a document dirty needs to start InteractionEvents, even if the command doesn't require user interaction.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(3) is important. Because a change of the document when another command is running sometime cause a crash of the command or Inventor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 01:15:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/commandmanager-activecommand-is-not-set-with-my-command/m-p/8848561#M75467</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-06-13T01:15:35Z</dc:date>
    </item>
  </channel>
</rss>

