Quantcast
Channel: Manufacturing DevBlog
Viewing all articles
Browse latest Browse all 516

Fusion 360 API: Work with Custom Palette

$
0
0

By Xiaodong Liang

I played with custom palette these days. I am sharing some practices. 

Firstly, the API help sample is a very good tutorial for us to get started with. Basically, the skeleton of palette is HTML, auxiliary js , css (except the js libraries of Fusion 360), the corresponding Fusion code (Python/C++) that consumes the HTML. 

When I was playing, I happened to hit an issue. The HTML elements were not shown up. It was only a white page. After checking with engineer team, it is addressed as a problem: current API does not encode the path of the local html which contains invalid character(such as space). This fix will be available soon. If you are testing right now, please put the dataset on a path without invalid character.

As said above, the skeleton of palette can include auxiliary js , css, which means we could apply with some nicer UI such as Bootstrap and the frameworks such as Jquery. The usage is simply like what you do in other web application. 

After the HTML is ready, I'd strongly suggest you open it to test it. It will be more easier to find out some problems. e.g. check the basic behavior of buttons, dropdown, checkbox, the workflows. The only that cannot test are the calls of Fusion 360., however you could at least check the parameters that are for communications with Fusion. In my test, I wanted to make a custom Export dialog. I have not made it work with [Choose Path] . The chooser does not show up.  In addition, I am working to add the workflow  [save to cloud]. 

 

Screen Shot 2017-09-01 at 5.56.20 PM

When the HTML and its workflow are ready, load the add-in to Fusion. If you do not want to debug, you could still view the HTML source or inspect element exactly like we program in web page. The browser engine Fusion uses is Chrome on Windows OS, Safari on Mac. 

Screen Shot 2017-09-01 at 6.04.45 PM

  Screen Shot 2017-09-01 at 6.08.18 PM

 

 

 

 

HTML and Js code

Fusion Add-In code


Viewing all articles
Browse latest Browse all 516

Trending Articles