Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is it possible to set the width of a dialog box in an API script?
Brad Bylls
Solved! Go to Solution.
Is it possible to set the width of a dialog box in an API script?
Solved! Go to Solution.
@Jorge_Jaramillo - this post is being edited to remove PII.
Hi,
I believe that Command.setDialogInitialSize Method is what you're looking for: https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-06bcc33f-87df-4894-b184-1666838547fe.
You can use it to set the initial size of a command dialog.
Regards,
Jorge Jaramillo
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.
https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-5C4D3AFA-AF61-4536-90C4-B7B4EE6A0E2D
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.
@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?
Regards,
Jorge Jaramillo
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.
Regards
MichaelT
See the attached.
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.
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.