Batch operations in Rhino files

Hello everyone,
We have thousands of files in our server that are almost never opened, but have to be there just in case.
If we could just delete their display meshes to save disk space, that would be great.

The files usually shrink to a 1/3 of the size when I use [SaveSmall] or [ClearAllMeshes].
I would like to know if there is a way to perform a batch operation of a Rhino macro, so that operation could be performed on all specified files at once.

Photoshop works like this: You create a “macro”, like “open this folder, do this and this, save and close”, Can you do that in Rhino, create a “macro” and it will apply it on several files at once?

I don’t know how to create a script like that from scratch, but if It thats possible with RhinoScript, Python or C# I would be very grateful for a direction from where to start.

Thank you!

Hello - here is an old RhinoScript from Dale Fugier - see how that works. Drag and drop it onto Rhino and then type in BatchSaveSmall to run it.

BatchSaveSmall.rvb (3.5 KB)

-Pascal

Hi Pascal, thanks for the response.
The ol’develpers page, some real hidden gems there

Had to make a little edit on Dale’s code to keep layers as they were and backwards compatibility, other than that the code works perfectly. My sample folder had 1,41GB, and after running the script, got down to 400MB. Perfect, just what I needed.

Thank you very much!