Plugin for exporting a group of selected STL meshes to separate files?

It takes way less time to export multiple files objects in one command with automatic naming than it does to do so one by one. Anybody have a command or plugin for this?

I have these:

Choice of 4 standard mesh settings
BatchExportSTLByObjWSett.py (3.9 KB)

Fixed settings (need to edit the script to your desired settings)
BatchExportSTLByObjWFixedSettings.py (1.8 KB)

I also have scripts for exporting by layer and by object name if needed.

2 Likes

Nice, thanks. Iā€™m going to try to work these out. I typically move all export models in 3dm format to 4 specific layers, I have a macro that auto-selects those layers and runs mesh repair on them, and then after that Iā€™m going to see if I can place it in the script to autorun. Thanks!

Morning, @Helvetosaur Would you happen to have that script for exporting selected (or even All) objects as individual rhino files?
At the moment, I have a bunch of imported Rock Meshes Iā€™d like to export to files.
Thx as always

EDIT: Thereā€™s this, but it doesnā€™t seem to SEPARATE the objects into individual exported files.

I have this maybeā€¦

BatchExport3dmByObject.py (1.5 KB)

Make sure you use SplitDisjointMesh before exporting, what you think are many separate mesh objects could in fact be only one Rhino object and thus will be exported as only one file.

1 Like

Thanks so much, will give it a shot right now!

EDIT: This is great. It did export individual rhino files per object.

QUESTION: I have multiple meshes Iā€™ve batch-renamed as Rock1-Rock9, though I could have a whole bunch more at some point. So, couple of neat ideas for Export Naming Options if you ever think theyā€™d be a worthy addition to this super helpful script:

  1. Current ObjName
  2. Edited ObjName
  3. Bonues Ideaā€¦Edited ObjName-in-series (i.e., if I have an asset folder with 49 ā€œRocksā€ in it, and Iā€™d like to Export the Rocks from my current Rhino project starting as ā€œRock-50ā€ and going to ā€œRock-nā€ for as many objects as Iā€™m exporting)

There is this:

BatchExport3dmByObjectPlusNames.py (1.7 KB)

Exports one Rhino file per object selected, export folder is same as current
folder if file has been saved; otherwise, choice of file name/location.  Named 
objects get object name as main filename, unnamed objects get filenname
"Unnamed-N" where N is a sequential number.

Not sure about ā€œEdited ObjNameā€

This could be managed - could ask the user for a main file name and a starting numberā€¦

1 Like

Thanks, let me give it a shot after I get something out the door by 11A

Iā€™m using Grasshopper and Elefront to export loads of parts into separate files

I think it would be nice to have the option of whether to use the filename or not, along with the obj name, etc. Sometimes you just want to export a piece of geo as a general reusable asset.

Thereā€™s another script I use for something else that lets you select the order of filename nomenclatures (i.e., ā€œFileNameā€; ā€œObjectNameā€; ā€œNumberā€ā€¦) And it leaves off any options you donā€™t select. This could be a really helpful way to name the exported files in this type of tool.

Could even have a ā€œCategoryā€ option in which you could enter a Custom phrase to categorize the Asset and make it searchable in folders.The final exported file could be something like:

Desert_Rock-1 (to be filed as a reusable asset)

or

AbandonedHouse_Ext_Desert_Rock-1 (to be filed within the hierarchy of the current working file)

I know itā€™s not me doing the work here! But I figure input can help make a better tool for all, along with all the other tools youā€™ve been nice enough to create and shareā€¦

Hi @Helvetosaur ,
Do you have also the same script but export to .iges?

How could i modify a script by myself?

No, I donā€™t have an IGES export in my library, but itā€™s not too hard to makeā€¦ As there are a whole bunch of export scripts - what are you looking to do? Export each selected object as a separate iges file? How do you want to name the files?

You can, if you know a little scriptingā€¦ the hardest part is setting up the export command string that it exports correctly. IGES can use different schemes - if nothing is scripted at the command line, it will use the most recent scheme choice or default if you have never chosen anything.

Yes Iā€™m looking to export each selected object in separate iges file (default setting), name the files as the name of the objectā€¦

Thank you @Helvetosaur !!

Try this one out and see if it meets your needs:
BatchExportIGESByObjectPlusNames.py (1.4 KB)

Edit - note I did not make any provision for multiple objects with the same name in the file, in that case the files will automatically get overwritten and only the last one will be there. There are ways to handle this, but itā€™s a bit of work.

1 Like