Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot get 16x16-dark.png image to show

1 REPLY 1
Reply
Message 1 of 2
adonno
227 Views, 1 Reply

Cannot get 16x16-dark.png image to show

Code I wrote expects the 16x16-dark.png image to show when BoolValueInput is selected. Instead I get 16x16.png in a dark blue background. The ScreenCast show the issue but here are some more details. I have a table in which there are 4 lines each with a BoolValueInput configured to work as a CheckBox. All that works great expect when each of the checkboxes are pressed the 16x16-pressed.png image shows up, but when the mouse button is released the images changes to the dark blue selected state but instead of the 16x16-dark.png image it shows the regular 16x16.png image. This is not what the documentation says should happen. What am I doing wrong?

 

Relevant documentation (from http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-F31C76F0-8C74-4343-904C-68FDA9BB8B4C) says: 

 

Finally, Fusion 360 also needs a version of the image that’s used when the command is active. In this case the button appears depressed and the background is a dark blue. You can create a custom image for this case so that any dark colors don’t disappear into the background. Frequently this is just a copy of the default image. The names of the images to use for the dark background are:

  • 16x16-dark.png - 16x16 pixel image showing the image to use with a dark background.

This is the code that adds each of the rows, in the ScreenCast you will see that I have all the relevant images in the folder called RadioButton.

    def add_row(self, table, row_id, name, image, initial_value=False):
        # Create a row
        table_child_inputs = table.commandInputs
        _radio_image = os.path.join(PATH, 'resources', 'RadioButton')
        _radio = table_child_inputs.addBoolValueInput(make_id(row_id), '', True, _radio_image, initial_value)

        # Add row to the table
        row = table.rowCount
        table.addCommandInput(_radio, row, 0)

 

 

1 REPLY 1
Message 2 of 2

Hello @adonno 

If you or someone still have this problem just restart Fusion and the next time the script is run it should read and displayed the "...-dark.png" images.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report