File Scripts

 From:  Michael Gibson
7119.10 In reply to 7119.9 
Hi Robert, you can get the current filename in script by moi.geometryDatabase.currentFileName - but be aware that it can be the empty string '' if there is not any current active file name.

To strip off the 3DM extension and add .obj you would do something like:

script: /* SaveAs no dialog */ var name = moi.geometryDatabase.currentFileName; if ( name != '' ) { moi.geometryDatabase.saveAs( name.substr(0, name.length) + 'obj', 'NoUI=true' ); }


I haven't tested that so it may have a typo in it.

- Michael