I need to do some fully automated mesh cleanup by “preprocessing” of a bunch of meshes, something like so:
Open a bunch of meshes (.obj files) from a Rhino instance.
Preprocess the Rhino model mesh objects using code only (no manual interaction)
In some cases using also GH geometry based on the soruce files, + bake back to Rhino .obj file.
Save the .obj files with other names.
Further process the resulting .obj files with another program (invoked from Rhino via .bat file, or by other means if better)
Then continue refining the resulting meshes from prev step in GH, +bake, and more like the above.
So all in all I need to import - process and export objects into and out of both “Rhino space” and “GH space” in several steps depending on problem to fix or geometry to add to the objects using different tools, all this being “orchestrated” from Rhino with extensive use of GH.
I have thousands of files to process according to a complex sequence of steps which works well manually but needs to be fully automated.
I would also want to know if it is possible to invoke Rhino5 + a specific gh-file + model file using a .bat file? (I would then let a GH component do all the above, and then take down Rhino when all model files are done processed)
I don’t know, this is a Rhino question, not a GH question.
However I can tell you it’s easier to automate stuff from within Grasshopper than from within Rhino, for the simple reason that GH is aware of Rhino but Rhino is not aware of GH.
If you’re willing to accept that in order to perform this automation you will start Rhino manually, start Grasshopper manually, load a gh file manually and assign some folder manually, only then to have GH loop over all files, execute all commands, load stuff into GH, process data, bake it back out and ultimately save the file again under a different name, then I can help out. Although it will require quite a lot of VB or C# code.
Absolutely, no problem. I can define paths etc in a text field and feed a GH component which orchestrates this, although I’d prefer GH to figure out on its own the FilePath to the current Rhino model file.
I’m already doing much of the processing in GH, so yes, GH will be the “Master” in this orchestra. I just need to get it all started automagically and knowing which workfolder to work in (this can be executed on any other computer, its an application for others to use, so GH must figure out in runtime where to pick up and dump its work).
Notice though that even if this is executed from GH,I will still have to let GH poke on the Rhino model at times, preparing it for import into other programs, such as Instant Meshes and other “fix tools”.