Create a button that redirects users to the web.

nwalo
Observer

Create a button that redirects users to the web.

nwalo
Observer
Observer

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.

0 Likes
Replies (4)

Jorge_Jaramillo
Collaborator
Collaborator

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

0 Likes

BrianEkins
Mentor
Mentor

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
1 Like

nwalo
Observer
Observer

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.

0 Likes

nwalo
Observer
Observer
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.
0 Likes