Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Using custom graphics while command inputs are not valid

nnikbin
Collaborator

Using custom graphics while command inputs are not valid

nnikbin
Collaborator
Collaborator

It seems that when ValidateInputsEventHandler determines that the inputs are not valid (using ValidateInputsEventArgs.areInputsValid Property), it not only disables the OK button, but also prevents the firing of ExecutePreview event handler. With that in mind, is there any method to use custom graphics when inputs are invalid and ExecutePreview event handler is disabled? For example use custom graphics to graphically show the user why inputs are not valid.

 

I thought instead of setting areInputsValid to false we can set Command.isOKButtonVisible to false to prevent execution of command, but it seems it is not possible to set isButtonVisible property outside CommandCreatedEventHandler.notify Method.

0 Likes
Reply
358 Views
2 Replies
Replies (2)

nnikbin
Collaborator
Collaborator

I found that I can use custom graphics in other parts of the program like in ValidateInputsEventHandler, but they remain on screen and I should delete them when I do not need them. Is it a good practice or we should only use them in ExecutePreview event handler?

0 Likes

kandennti
Mentor
Mentor

Hi @nnikbin .

 

I don't think there is any limit to where I can use it.

1 Like