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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dialog width

Message 1 of 10
322 Views, 9 Replies

Dialog width

Is it possible to set the width of a dialog box in an API script?

Brad Bylls
Message 2 of 10

@Jorge_Jaramillo - this post is being edited to remove PII.



I believe that Command.setDialogInitialSize Method is what you're looking for:
You can use it to set the initial size of a command dialog.

Jorge Jaramillo

Message 3 of 10
in reply to: brad.bylls

Hi @brad.bylls -San.


I hadn't thought of this, but it certainly may not be configurable.


With Palette, it is possible to specify the width. 

Message 4 of 10

Does this command only work once?

I used it and it set the width and height the first time.

However, I changed the width because it was too large, but nothing changed.

I tried several times to change the width but nothing changed.

Brad Bylls
Message 5 of 10

@Jorge_Jaramillo - this post is being edited to remove PII.


hi @brad.bylls ,


It depends where in your code you set its size.

Without knowing your code it is hard to solve the issue.

Could you share it?



Jorge Jaramillo


Message 6 of 10
in reply to: brad.bylls

Hi Mr BradBylls,


The doc contains a little cryptic sentence:


Sets the initial size of the dialog when it is first displayed.


... which is perhaps responsible for what you are experiencing. On the bright side of things ... you are not the only One.






Message 7 of 10
in reply to: MichaelT_123

So if you don't know what size you need, too bad.
No good for me.
Brad Bylls
Message 8 of 10

See the attached.

Brad Bylls
Message 9 of 10
in reply to: brad.bylls

The behavior of this is a bit strange. When this part of the API was first implemented, we wanted to give full control over the size of the dialog but found out that wasn't supported by Fusion internals. Most dialogs don't have a defined size, and they share the latest dialog state. For example, if you run a command and then resize the dialog, then run another command, the new command will display using the new size. However, the user last modified the dialog becomes the new default for most commands. You can specify the initial size for commands where you want more control over the size. Fusion uses that when the dialog is first created, but it stores that size internally for the dialog and uses the stored size from then on. It does this because if the user modifies the dialog size, that becomes the new default size.


I still think it would be good to support a mode where you can define the dialog size and either not allow the user to change it or at least not save any modifications the user makes so it always goes back to the defined size. It's possible some internals have changes to make this a possibility, but I don't know.

Brian Ekins
Inventor and Fusion 360 API Expert
Message 10 of 10
in reply to: BrianEkins

Thanks Brian.

My add-in has many different dialogs and most can use the same size.

But there are some that need a very wide dialog, and some only need a narrow one.

It would be nice if I could define the size for each dialog as needed.

At least then the user wouldn't have to keep changing them to suit.


Brad Bylls

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