File Scripts

 From:  Michael Gibson
7119.7 In reply to 7119.6 
Hi Robert, yes it's possible through script to directly specify meshing settings and prevent the mesh dialog from appearing.

You can do that by this script on a shortcut key:


script: /* SaveAs no dialog */ moi.geometryDatabase.saveAs( 'c:\\mydir\\myfile.obj', 'NoUI=true' );


Some notes on that - the saveAs method takes 2 string parameters, the first is the file name, and the second is a set of options.

Strings in JavaScript use the backslash \ character as an escape for making special characters like \r means carriage return.
To make a single backslash inside of a JavaScript string use \\ - that's why those are doubled in the above script.


Then for the second parameter you can put different values seprated by semi-colons, if you put 'NoUI=true' it will not show the mesh dialog and use default values. If you put 'NoUI=true;Angle=6' for example that has 2 parameters - NoUI=true for not showing the dialog and it will use an Angle value of 6 for the export.

The different available parameters are described below:

// 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:
// (note: | denotes mutually exclusive options, for example for Output choose one
// of the given options, like Output=quads)
//
// NoUI=true
// Angle=12.0
// Output=ngons | quads | triangles
// MaxLength=0.0
// MaxLengthApplyTo=curved | planes | all
// MinLength=0.0
// AspectRatio=0.0
// Weld=true
// Display=shadedwithedges | shadednoedges | wireframe
// ExpandedDialog=false


- Michael