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: 

Create a button that redirects users to the web.

4 REPLIES 4
Reply
Message 1 of 5
nwalo
202 Views, 4 Replies

Create a button that redirects users to the web.

I wish to create an add-in which would be able to live in fusion and when clicked on, it redirects the user to the web browser where he can do some other things. How can I implement this using Python and/or javascript.

4 REPLIES 4
Message 2 of 5
Jorge_Jaramillo
in reply to: nwalo

Hi,

 

In this example you can see how to build an addin which creates a button, and once it is clicked a palette will open to display a local HTML file.  You can also load a public web on it.  Or if you want, you can start a web browser outside of Fusion360 (be aware there won't be native communication between the web browser and Fusion360).

The code is made in Python.  Javascript is not longer supported.

 

Hope this help.

 

Regards,
Jorge

Message 3 of 5
BrianEkins
in reply to: nwalo

Here's some code that will open up your default browser to a specified URL.

 

import webbrowser
webbrowser.open('https://www.autodesk.com', new=2)

 

Here's the official documentation for webbrowser.

https://docs.python.org/3.9/library/webbrowser.html

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 4 of 5
nwalo
in reply to: nwalo

Thank you, from the example, you have to click on show to open a pellet before you can click the button. but I need the button to have my company's logo/icon on it and when you click on it, it opens the web browser outside fusion immediately.

Message 5 of 5
nwalo
in reply to: BrianEkins

great resource, i have learnt so much with this, please could you assist me on how to create the plugin? it should have the any image i want, and it should not open any pallete, only redirect.

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