MoI discussion forum
MoI discussion forum

Full Version: Script to automatically export and save stl file

Show messages: All  1-3  4-7

From: Michael Gibson
5 Nov   [#4] In reply to [#3]
Hi Matadem, also when you export to an .stl file normally the "Meshing options" dialog box is shown so you can adjust the mesh density.

Do you want that dialog to be shown or do you want it to use some some specific mesh settings each time and if so what settings?

- Michael
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-3  4-7