Hi Jeff,
Thanks for the reminder, I'm late checking back in to this thread.
The new API will be available in the next update of Fusion that is comming soon. As I have mentioned before we will support JavaScript as the scripting language in this update but the plan is to support C++ and Python versions of the API in subsequent updates too.
Here is a sample to give you an idea of what the API will look like. This following script will open a comma seperated file and read in point information to create a spline in the active document. This is only a small example of what you can do.
var app = adsk.core.Application.get();
ui = app.userInterface;
var design = adsk.fusion.Design(app.activeProduct);
var title = 'Import Spline CSV';
if (!design) {
ui.messageBox('No active design', title);
adsk.terminate();
return;
}
var dlg = ui.createFileDialog();
dlg.title = 'Open CSV File';
dlg.filter = 'Comma Separated Values (*.csv);;All Files (*.*)';
if (dlg.showOpen() !== adsk.core.DialogResults.DialogOK) {
adsk.terminate();
return;
}
var filename = dlg.filename;
var buffer = adsk.readFile(filename);
if (!buffer) {
ui.messageBox('Failed to open ' + filename);
adsk.terminate();
return;
}
var data = adsk.utf8ToString(buffer);
data = data.split('\n');
var i, j, points = adsk.core.ObjectCollection.create();
for (i = 0;i < data.length;++i) {
data[i] = data[i].split(',');
for (j = 0;j < data[i].length;++j) {
data[i][j] = parseFloat(data[i][j]);
}
if (data[i].length >= 3) {
var point = adsk.core.Point3D.create(data[i][0], data[i][1], data[i][2]);
points.add(point);
}
}
var root = design.rootComponent;
var sketch = root.sketches.add(root.xYConstructionPlane);
sketch.sketchCurves.sketchFittedSplines.add(points);
If you, or anyone else interested in this topic, would like to talk to me about the API and how you would want to use it, please email me [email protected]'ll happily setup a web meeting for us to look at the current API and talk about we can enhance it in the future.
Thanks,
Bankim