Open rhino files, bake with grasshopper then close everything

hi !

totaly new to scripting I was wondering if some of you can help me finding tutorials or solutions to this problem who is probably very basic for people who are used to script :slight_smile:

I want to open .3dm files who are all in different subfolder in a master folder named 3D
(D:/project/tree/3D/"different subfolders)
I have tons of .3dm files in this folder, but all the one I want to process contains “ET_” in their file name.
such as :

for every file I want rhino to open and run a grasshopper file who export CSV and a GEO files (kind of text file and excell file), wait that it’s done, then closed everything…

any Idea ?

thanks !

so I did try something with .bat
after some work (maybe more them one hour) I’am no able to turn on rhino… nut still very far from my purpose… and I just can’t do anything more, like trying to launch a specific command or script…
I show you :

any help ?
is .bat the good way to do it ?

Hi @antho2b, sorry no.

If you’re just starting with scripting i would recommend to try the task with a RhinoScript written in Python or VBScript. Using a script which is started from the Python Editor (_EditPythonScript) when Rhino is already open allows easier access to Rhino commands as well as to Grasshopper. Doing it with a *.bat file requires to have external access which only works with automation and COM. You can find more info about this here.

Since using COM or *.bat is not required if you already have opened Rhino, you may first find some examples on how to batch-open files in sub-folders.

Once you handled that here is an example which explains how to open GH, a GH definition and then bake something using a python script…