<?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: Disable custom command in other environment in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/disable-custom-command-in-other-environment/m-p/11111612#M136886</link>
    <description>&lt;P&gt;To disable and enable commands you need to get hold of the "ControlDefinition". This property can "Enables/Disables the UIDefinition objects.". That could work like this:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim Ribbon As Ribbon = ThisApplication.UserInterfaceManager.Ribbons.Item("Ribbon name")
Dim ribbonTab As RibbonTab = Ribbon.RibbonTabs.Item("Ribbon tab name")
Dim ribbonPanel As RibbonPanel = ribbonTab.RibbonPanels.Item("Ribbon panel name")
Dim commandControl As CommandControl = ribbonPanel.CommandControls.Item("Command controls name")

commandControl.ControlDefinition.Enabled = False&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 18 Apr 2022 10:45:47 GMT</pubDate>
    <dc:creator>JelteDeJong</dc:creator>
    <dc:date>2022-04-18T10:45:47Z</dc:date>
    <item>
      <title>Disable custom command in other environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/disable-custom-command-in-other-environment/m-p/11111590#M136884</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have created several custom command which work in Drawing, Part and Assemblies. And I have use OnEnviromentChange event to enable &amp;amp; disable those. But while doing this Dynamic simulation and Stress Analysis was disable automatically. When I'm removing this event then both are enabled.&lt;BR /&gt;&lt;BR /&gt;Can anyone help me to resolved it?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 10:26:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/disable-custom-command-in-other-environment/m-p/11111590#M136884</guid>
      <dc:creator>jatindevaiya08</dc:creator>
      <dc:date>2022-04-18T10:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Disable custom command in other environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/disable-custom-command-in-other-environment/m-p/11111612#M136886</link>
      <description>&lt;P&gt;To disable and enable commands you need to get hold of the "ControlDefinition". This property can "Enables/Disables the UIDefinition objects.". That could work like this:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim Ribbon As Ribbon = ThisApplication.UserInterfaceManager.Ribbons.Item("Ribbon name")
Dim ribbonTab As RibbonTab = Ribbon.RibbonTabs.Item("Ribbon tab name")
Dim ribbonPanel As RibbonPanel = ribbonTab.RibbonPanels.Item("Ribbon panel name")
Dim commandControl As CommandControl = ribbonPanel.CommandControls.Item("Command controls name")

commandControl.ControlDefinition.Enabled = False&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 18 Apr 2022 10:45:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/disable-custom-command-in-other-environment/m-p/11111612#M136886</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2022-04-18T10:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Disable custom command in other environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/disable-custom-command-in-other-environment/m-p/11111847#M136891</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have used UserInterFace as well as UserInput Event. So some of the command is in ribbon and some on ContextMenu.&lt;BR /&gt;That's why I have used OnEnvironmentChange Event to disabled it. But facing issue in Assembly Environment only where those two command is disabled.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 13:54:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/disable-custom-command-in-other-environment/m-p/11111847#M136891</guid>
      <dc:creator>jatindevaiya08</dc:creator>
      <dc:date>2022-04-18T13:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Disable custom command in other environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/disable-custom-command-in-other-environment/m-p/11115646#M136981</link>
      <description>&lt;P&gt;Instead of OnEnvironmentChange I have used OnActiveDocument event to disable or enable custom command and it's work fine. Dynamic simulation and Stress Analysis is not disabled by this method.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 03:17:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/disable-custom-command-in-other-environment/m-p/11115646#M136981</guid>
      <dc:creator>jatindevaiya08</dc:creator>
      <dc:date>2022-04-20T03:17:28Z</dc:date>
    </item>
  </channel>
</rss>

