Batch file conversion

 From:  Micha
2100.22 In reply to 2100.20 
Thank you very much - it works phantastic!

Here some code I change, maybe useful for other user.
I edit the convert.js file, so that the meshing UI popup and I can choose specific parameters:

---------------
function Convert(FileName)
{
var gd = moi.geometryDatabase;

// Open the file, set 2nd param to true to suppress any save changes prompt.
gd.open( FileName, true );

// Create the output file name by breaking off the file extension and adding 'obj'.

OBJFileName = FileName.substr( 0, FileName.lastIndexOf('.') + 1 ) + 'obj';

// Save out to the output file, passing the option to suppress the UI. You
// add other options separated by semi-colons with no spaces. These
// options are available for controlling the meshing:
// NoUI=true
// Angle=12.0
// Output=ngons | quads | triangles
// MaxLength=0.0
// MaxLengthApplyTo=curved | planes | all
// MinLength=0.01
// AspectRatio=0.0
// Weld=true
// Display=shadedwithedges | shadednoedges | wireframe
// ExpandedDialog=false

gd.saveAs( OBJFileName, 'Angle=12.0;MinLength=0.01;MaxLength=1000;AspectRatio=20;Weld=true;Output=quads');

// Let's clear out and suppress any save changes prompt again.
gd.fileNew( true );
}
------------

My Rhino button scripts are:

_-export "d:\temp\moi.3dm" _enter _enter
_-run "C:\Program Files (x86)\MOI 2.0\LaunchMoIBatchConvert.cmd"

_delete
_-import "d:\temp\moi.obj" _enter

The second button script delete the NURBS object and place the mesh at the same place. Here a simple button image to make it complete.


For quick meshing I create an automatic button, that doe's all this without meshing UI.

The modified scripts are attached and here the button script:

_-export "d:\temp\moi.3dm" _enter _enter
_-run "C:\Program Files (x86)\MOI 2.0\LaunchMoIAutoConvert.cmd"
_delete
_-import "d:\temp\moi.obj" _enter

There is a problem with the automatic button - the moi.obj is imported before the meshing is finished. I think, it could be good to add a command or switch, so that the script wait until the meshing is finished. I would like to avoid a wait command with a fixed time. Anybody has an idea? ;)