MoI discussion forum
MoI discussion forum

Full Version: Script to automatically export and save stl file

Show messages: All  1-4  5-7

From: Matadem
5 Nov   [#5]
Attached is what I use.
I does not even need to pop up since I do not change anything...

Thanks!

Image Attachments:
Capturemoi.JPG 


From: Michael Gibson
5 Nov   [#6] In reply to [#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
From: Matadem
5 Nov   [#7]
Nice Thank you! work great.

Show messages: All  1-4  5-7