<?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: Command button is empty when isPromoted property is set to True in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/command-button-is-empty-when-ispromoted-property-is-set-to-true/m-p/5623952#M21271</link>
    <description>Thanks, now it works as expected.</description>
    <pubDate>Thu, 07 May 2015 07:04:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-05-07T07:04:30Z</dc:date>
    <item>
      <title>Command button is empty when isPromoted property is set to True</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/command-button-is-empty-when-ispromoted-property-is-set-to-true/m-p/5622577#M21268</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another problem, this time with UI.&lt;/P&gt;&lt;P&gt;I'm making my own tool bar panel with single command button.&lt;/P&gt;&lt;P&gt;The problem is that when I set isPromoted value to True button appears in the Panel but it's empty. No icon, no tool tip, no action assigned to it. Just empty placeholder.&lt;/P&gt;&lt;P&gt;When I disable isPromoted then command button is availabe when I click on small arrow and it works as expected.&lt;/P&gt;&lt;P&gt;Is there any way to fix this and have button displayed in the panel?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;buttonTheaExport = cmdDefs.addButtonDefinition('TheaExportDefIdPython', 'Export to Thea', 
                                                    'Export to Thea',
                                                    './/Resources//theaExport')
        
# Connect the command created event.
TheaExportCommandCreated = TheaExportCommandCreatedEventHandler()
buttonTheaExport.commandCreated.add(TheaExportCommandCreated)
handlers.append(TheaExportCommandCreated)

# Create new panel
theaPanel = ui.toolbarPanels.add('theaPanelId', 'Thea Render')
exportControl = theaPanel.controls.addCommand(buttonTheaExport, 'TheaExportCmdDefControl')        
exportControl.isPromoted = True
exportControl.isPromotedByDefault = True&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 10:33:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/command-button-is-empty-when-ispromoted-property-is-set-to-true/m-p/5622577#M21268</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-06T10:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Command button is empty when isPromoted property is set to True</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/command-button-is-empty-when-ispromoted-property-is-set-to-true/m-p/5623193#M21269</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;A id="link_9e57caf4997273" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2960136" target="_self"&gt;grzyboo&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;I cannot see anything wrong with your code in the context of the snippet you shared. &amp;nbsp;Can you post the entire script?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;DaVeR&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 16:50:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/command-button-is-empty-when-ispromoted-property-is-set-to-true/m-p/5623193#M21269</guid>
      <dc:creator>david_reaume</dc:creator>
      <dc:date>2015-05-06T16:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Command button is empty when isPromoted property is set to True</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/command-button-is-empty-when-ispromoted-property-is-set-to-true/m-p/5623793#M21270</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a known issue that the command id should be the same as the ButtonDefinition id, otherwise the promoted comand control will be blank because the command cannot be connected with the button definition in Fusion. Please try the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;buttonTheaExport = cmdDefs.addButtonDefinition('TheaExportDefIdPython​', 'Export to Thea', &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Export to Thea',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; './/Resources//theaExport')&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;# Connect the command created event.&lt;BR /&gt;TheaExportCommandCreated = TheaExportCommandCreatedEventHandler()&lt;BR /&gt;buttonTheaExport.commandCreated.add(TheaExportComm​andCreated)&lt;BR /&gt;handlers.append(TheaExportCommandCreated)&lt;BR /&gt;&lt;BR /&gt;# Create new panel&lt;BR /&gt;theaPanel = ui.toolbarPanels.add('theaPanelId', 'Thea Render')&lt;BR /&gt;exportControl = theaPanel.controls.addCommand(buttonTheaExport, &lt;STRONG&gt;'TheaExportDefIdPython​'&lt;/STRONG&gt;)&amp;nbsp; #&amp;nbsp;The id of the&amp;nbsp;command&amp;nbsp;is changed.&lt;BR /&gt;exportControl.isPromoted = True&lt;BR /&gt;exportControl.isPromotedByDefault = True&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In our comming release, the design of the API method "addCommand" is changed. And then you doesn't need to set the id when "addCommand". And the command control's id will inherit from the button definition.&amp;nbsp;So in our next release, you just need to call the function like this: exportControl = theaPanel.controls.addCommand(buttonTheaExport)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for inconvenience&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Zhijie&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2015 01:33:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/command-button-is-empty-when-ispromoted-property-is-set-to-true/m-p/5623793#M21270</guid>
      <dc:creator>zhijie.li</dc:creator>
      <dc:date>2015-05-07T01:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Command button is empty when isPromoted property is set to True</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/command-button-is-empty-when-ispromoted-property-is-set-to-true/m-p/5623952#M21271</link>
      <description>Thanks, now it works as expected.</description>
      <pubDate>Thu, 07 May 2015 07:04:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/command-button-is-empty-when-ispromoted-property-is-set-to-true/m-p/5623952#M21271</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-07T07:04:30Z</dc:date>
    </item>
  </channel>
</rss>

