<?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: Disabling/enabling of control definition not working in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/disabling-enabling-of-control-definition-not-working/m-p/11184096#M138383</link>
    <description>&lt;P&gt;I have no experience with C++. But have you seen &lt;A href="http://www.ransensoftware.com/Inventor-CPP/" target="_blank" rel="noopener"&gt;this&lt;/A&gt; site by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1206331"&gt;@oransen&lt;/a&gt; . There is a lot of information there. Maybe you can find an answer there.&lt;/P&gt;</description>
    <pubDate>Sat, 21 May 2022 10:55:42 GMT</pubDate>
    <dc:creator>JelteDeJong</dc:creator>
    <dc:date>2022-05-21T10:55:42Z</dc:date>
    <item>
      <title>Disabling/enabling of control definition not working</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/disabling-enabling-of-control-definition-not-working/m-p/11180074#M138286</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;In our addon (developed in c++), trying to disable/enable few control definitions and works for most of controls. Disabling of control definition - "MoldCreateMoldDesign" is not working and remain enabled in ribbon.&lt;BR /&gt;Display name in ribbon: Create Mold Design in Environment menu.&lt;/P&gt;&lt;P&gt;Executing below code in document activate event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;c++ code:&lt;BR /&gt;CComPtr&amp;lt;CommandManager&amp;gt; pCommandManager;&lt;BR /&gt;HRESULT hr = pApplication-&amp;gt;get_CommandManager(&amp;amp;pCommandManager);&lt;BR /&gt;ControlDefinitionsPtr defs = pCommandManager-&amp;gt;GetControlDefinitions();&lt;/P&gt;&lt;P&gt;long defCount = 1;&lt;BR /&gt;CComPtr&amp;lt;ControlDefinition&amp;gt; pDef;&lt;BR /&gt;//Iterate through the controls&lt;BR /&gt;for (; (hr = defs-&amp;gt;get_Item(CComVariant(defCount), &amp;amp;pDef)) == S_OK; pDef.Release())&lt;BR /&gt;{&lt;BR /&gt;++defCount;&lt;BR /&gt;std::wstring iname = pDef-&amp;gt;GetInternalName();&lt;BR /&gt;if (iname == L"MoldCreateMoldDesign")&lt;BR /&gt;{&lt;BR /&gt;pDef-&amp;gt;put_Enabled(VARIANT_FALSE);&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also checked in vba code and disabling properly.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;vba code:&lt;BR /&gt;Sub DiableCommandName()&lt;BR /&gt;Dim oCommandMgr As CommandManager&lt;BR /&gt;Set oCommandMgr = ThisApplication.CommandManager&lt;BR /&gt;&lt;BR /&gt;Dim oControlDefs As ControlDefinitions&lt;BR /&gt;Set oControlDefs = oCommandMgr.ControlDefinitions&lt;/P&gt;&lt;P&gt;Dim oControlDef As ControlDefinition&lt;/P&gt;&lt;P&gt;'Iterate through the controls.&lt;BR /&gt;For Each oControlDef In oControlDefs&lt;BR /&gt;If oControlDef.InternalName = "MoldCreateMoldDesign" Then&lt;BR /&gt;oControlDef.Enabled = False&lt;BR /&gt;End If&lt;BR /&gt;Next&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Why same logic not working in c++ addon?&lt;BR /&gt;what is the solution to disable/enable "MoldCreateMoldDesign" control?.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 May 2022 14:34:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/disabling-enabling-of-control-definition-not-working/m-p/11180074#M138286</guid>
      <dc:creator>prakash.muthu</dc:creator>
      <dc:date>2022-05-19T14:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling/enabling of control definition not working</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/disabling-enabling-of-control-definition-not-working/m-p/11184096#M138383</link>
      <description>&lt;P&gt;I have no experience with C++. But have you seen &lt;A href="http://www.ransensoftware.com/Inventor-CPP/" target="_blank" rel="noopener"&gt;this&lt;/A&gt; site by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1206331"&gt;@oransen&lt;/a&gt; . There is a lot of information there. Maybe you can find an answer there.&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2022 10:55:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/disabling-enabling-of-control-definition-not-working/m-p/11184096#M138383</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2022-05-21T10:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling/enabling of control definition not working</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/disabling-enabling-of-control-definition-not-working/m-p/11191646#M138501</link>
      <description>&lt;P&gt;Checked&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://www.ransensoftware.com/Inventor-CPP/" target="_blank" rel="noopener nofollow noreferrer"&gt;this&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp; site and no solution found.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 08:22:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/disabling-enabling-of-control-definition-not-working/m-p/11191646#M138501</guid>
      <dc:creator>prakash.muthu</dc:creator>
      <dc:date>2022-05-25T08:22:32Z</dc:date>
    </item>
  </channel>
</rss>

