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: 

command.isOKButtonVisible

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
brad.bylls
164 Views, 3 Replies

command.isOKButtonVisible

In my code I have this in my UI create method: command.isOKButtonVisible = False

This works because when the UI is created, the OK button is not visible.

Later in the code when the user has selected everything he/she is supposed to, I have: command.isOKButtonVisible = True

This however does not work.

I have checked to make sure it is run during debugging.

What am I missing?

Brad Bylls
3 REPLIES 3
Message 2 of 4
kandennti
in reply to: brad.bylls

Hi @brad.bylls .

 

Perhaps the isOKButtonVisible property only works on the commandCreated event.


It would be easier for the user to understand if the OK button is grayed out until the conditions for executing the command are met, and then the OK button can be pressed when the conditions are met.


The state of the OK button can be changed using the validateInputs event and the areInputsValid property.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-48f1c5e6-9c63-4da4-b0eb-6701e8569013 

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-dcf60135-6fcf-4ca5-bd53-b9df4cbea341 

Message 3 of 4
brad.bylls
in reply to: kandennti

It is a matter of taste if the OK button is greyed out or not visible at all.

If I can change the visibility to False, it should also change to true the same way.

It seems that using the validatInputs event is a lot more unnecessary code if the OKButtonIsvisible would work.

And for my situation that would be just fine.

I will however explore your suggestion.

Thank you. 

Brad Bylls
Message 4 of 4
BrianEkins
in reply to: brad.bylls

I would expect the same behavior as you about making the OK button visible, but I'm also not too surprised that it's not working.  The original use was to hide it for the dialog completely, so there was never a reason to make it visible again, and this workflow was likely never tested.  All of the built-in Fusion commands behave as Kandennti described, which is to show the OK button but have it disabled until the user has provided valid input.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com

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