Command.setDialogInitialSize

Command.setDialogInitialSize

rolandas_vegis
Advocate Advocate
859 Views
4 Replies
Message 1 of 5

Command.setDialogInitialSize

rolandas_vegis
Advocate
Advocate

Command.setDialogInitialSize doesn't care about its params. No matter what numbers I give it the dialog is the same size (not the default one, it's bigger).

 

Also pretty sure Command.setDialogMinimumSize doesn't work at all.

Accepted solutions (1)
860 Views
4 Replies
Replies (4)
Message 2 of 5

BrianEkins
Mentor
Mentor
Accepted solution

This method does work but unfortunately doesn't work like you would expect or how I had in mind when I designed it.  The reason for the current behavior is because of how the internals of Fusion 360 work.  Basically, this method is only effective the very first time your add-in run.  It will set the size of the dialog.  However, if the user manipulates the dialog and changes the size, Fusion 360 now remembers this new size as the default and it overrides whatever you set with setDialogInitialSize.  What's needed is a setDialogSize where you specify and have full control over the size.  Some additional capabilities needed to be added to Fusion 360 core before we could add that to the API and it hasn't happened yet.

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

nnikbin
Collaborator
Collaborator

Hi @BrianEkins,

It seems that fusion 360 caches dialog minimum size the first time setDialogMinimumSize is called for the add-in. The next calls to setDialogMinimumSize does not change the saved dimentions (at least on my Windows machine). Is there any way to clear this cache?

0 Likes
Message 4 of 5

Joshua.mursic
Advocate
Advocate

Hey @BrianEkins, is this still the case? I am unable to change the size of the dialog to dynamically fit the content inside.

0 Likes
Message 5 of 5

BrianEkins
Mentor
Mentor

This is still the same, although I've heard that an enhancement may be coming. 

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