Fusion360 palette interaction
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone!
I have trying to develop Fuion360 add-in base on palette and this sample. I general my application should be able to send data from Fusion to the website, which is loaded in palette, and send data in opposite direction from website to Fuion360.
But unfortunately I have encountered an issue of determining a moment of time when pallete finished initialization.
With out it any requests from JS code to Fusion360 fails with error
adsk.fusionSendData('send', data);
Uncaught ReferenceError: adsk is not defined at sendInfoToFusion (palette.html:20)
I was trying to wait for ADSK object initialization by simple JS script
window.onload = function () { var adskWaiter = setInterval(function () { console.log('wait for adsk object'); if (window.adsk) { clearInterval(adskWaiter); adsk.fusionSendData('send', '{"arg1":"Sample argument 1","arg2":"Sample argument 2"}'); }; }, 500); }
And some times it works, but in most cases ADSK became available only after I opened devTools
Could anyone suggest how to force adsk object initialization, and catch moment when in finished?
PS: I have tested on Windows version of Fusioon360 build number 2.0.5103 with PalleteTest.zip