Script to automatically export and save stl file

 From:  Michael Gibson
11823.6 In reply to 11823.5 
Hi Matadem, try this script you can put it in as the "Command" part of a shortcut key:

script: var dir = 'c:\\scripts\\'; var filename; var counter = 0; while ( 1 ) { ++counter; filename = dir + 'stl' + counter + '.stl'; if ( !moi.filesystem.fileExists( filename ) ) { break; } } moi.geometryDatabase.saveAs( filename, 'NoUI=true;Angle=3.0' );


Change the 'c:\\scripts\\' to your output directory, backslashes need to be doubled and there should be a backslash at the end.

It will write an .stl file named stl1.stl, stl2.stl, etc... , bumping up the number until it finds an unused one.

- Michael