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: 

Minimal UI with mutliple inputs example

3 REPLIES 3
Reply
Message 1 of 4
whunter
550 Views, 3 Replies

Minimal UI with mutliple inputs example

Hi,

 

I was wondering if anyone has a Python example of how to create a minimal UI (similar to the one used in the Bolt script), but without using Classes. Or are the Classes absolutley necessary?

 

It doesn't have to create geometry, just a simple UI with 2 or 3 inputs and return the entries in a Messagebox.

 

Thanks,

William

3 REPLIES 3
Message 2 of 4
ekinsb
in reply to: whunter

This is an area that is not currently documented, but needs to be.

 

The classes you're seeing are used to handle events which are a key part of creating a Fusion command.  The standard Fusion dialogs you see are always associated with a command which means if you want to use a dialog you have to create a command.  The first event handler is to get notified when your command is created (run by the user).  In reaction to this you build up the dialog and then can handle events to validate the input as it's entered and set up to listen for when the command is executed.  This is when the "OK" button has been clicked and the command needs to do whatever the command does.

 

Currently, for simple dialog input outside of a command you need to look outside of what Fusion provides and look at what's available in other libraries.  Tkinter is one of these and is a GUI library that comes standard with Python.  We'll be providing some samples demonstrating the use of Tking in the future.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 3 of 4
whunter
in reply to: ekinsb

Hi Brian, thanks for the reply.

 

Will PySide remain a GUI option (seeing that it ships Fusion/Spyder)? I tried a simple PySide "Hello, World!" script in Fusion and it worked.

 

Regards,

William

 

Message 4 of 4
ekinsb
in reply to: whunter

PySide provides Pythong bindings to Qt.  The Qt libraries that you desribed are part of Spyder since it uses Qt for its UI.  Because Fusion is installing Spyder that PySide library is being installed.  Fusion also uses Qt for its UI.  Because of this we can't recommend that you use Qt because of potential conflicts.  All of the libraries that Fusion/Autodesk use have been renamed to avoid clashes but there's the posibility that two Qt libraries running in the same process might have some conflict and either cause you or Fusion problems.  We've not done any testing to know if there are problems or not.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog

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