
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am playing around with the fusion 360 API.
I am basically want to create an assembly based from a local read XML file. I am getting so far so show a file dialog and let the user select the XML-File. Then I read the file using adsk.readFile(dialog.filename). But I have no success doing anything further with the buffer because two approaches to convert the ArrayBuffer into something sensible. Here is what I tried:
Approach 1:
var dataView = new DataView(contentBuffer);
var decoder = new TextDecoder(encoding);
var decodedString = decoder.decode(dataView);
Approach 2:
String.fromCharCode.apply(null, new Uint16Array(contentBuffer));
Both approaches fail because either DataView is not found or Uint16Array is not found. I found both approaches on the internet but as far as I see, these are standard approaches to process ArrayBuffers in current javascript environments.
I miss those "standard libraries". Can you comment on the availability of javascript standard libraries?
Solved! Go to Solution.