MoI discussion forum
MoI discussion forum

Full Version: Script request

Show messages: All  1-10  11-12

From: Michael Gibson
10 Jun   [#11] In reply to [#10]
Hi shayne,

re:
> it errors
>
> ReferenceError: Can't find variable: basename

It looks like you only copied the last piece of the above script?

You are missing this part in the new version above:

script: var folder = 'c:\\scripts\\'; var filename = moi.geometryDatabase.currentFileName; if ( filename ) { var index = filename.lastIndexOf( '.' ); if ( index != -1 ) { var basename = filename.substr( 0, index ); filename = basename + '.stl'; filename = folder + moi.filesystem.getFileNameFromPath( filename ); moi.geometryDatabase.saveAs( filename, 'NoUI=true;Angle=3' ); moi.copyTextToClipboard( moi.filesystem.getFileNameFromPath(basename) ); } }

Try copying the entire script from above not just the ending part.

- Michael
From: shayno
10 Jun   [#12]
Works perfect thanks shayne

Show messages: All  1-10  11-12