Unable to disable "Control Definition"

Unable to disable "Control Definition"

subhransuBAD5A
Explorer Explorer
573 Views
1 Reply
Message 1 of 2

Unable to disable "Control Definition"

subhransuBAD5A
Explorer
Explorer

Hi All,

I am developing an Fusion360 Add-in (It is in C++), it consist of command definition. I am trying to disable it,

Following is the code block that I am  trying to implement.

 

Ptr<CommandDefinition> commandDefinitionPanel = commandDefinitions->itemById(commandIdOnPanel);
 
          if (!commandDefinitionPanel)
          {
                  commandDefinitionPanel = commandDefinitions->addButtonDefinition(commandIdOnPanel, commandName, commandDescription, commandResources);
                  commandDefinitionPanel->controlDefinition()->isEnabled(false);
          }

Code compiled and run successfully, but the button definition still enable.

 

Thanks in advance.

0 Likes
574 Views
1 Reply
Reply (1)
Message 2 of 2

ekinsb
Alumni
Alumni

I thought I had replied to this earlier, sorry about the delay.  I did some quick testing when you originally posted this and am now writing a test case that I can use to file a bug.  I'm seeing something interesting in that it looks like the isVisible and isEnabled properties are working but then Fusion automatically sets them back after a few seconds.  I'm not exactly sure what's going on but I'll file the bug so it can be investigated and fixed.  Thanks for reporting this.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes