Bake a Rhino file headless from Python Script

Hi everyone!

I know the subject has already been discussed but none of the posts i looked managed to solve my issue.

I am trying to compute a GH solution headlessly. The GH file itself is pretty simple:

  • A custom Python component loads data from a file as a parameter (config/my_dimensions.txt)
  • This parameter passes through different GH components to model a solution (here the example is a simple 2Pt Box)
  • A custom Python component bakes resulting Brep in a Rhino file

This workflow works just fine manually. It gets more complicated when i try to run it headlessly: i tried two approaches:

  • Recompute solution for whole document
  • Trigger the specific export document

None of the solutions seem to work. Attached you will find the .gh file as well as the Python external script. Any help would be greatly appreciated, i’m a bit lost here!

Thanks!

simplified_export.ghx (151.8 KB)
run_grasshopper.py (2.7 KB)

Hi @Quentin1,

sorry to be not specific helpful but is this not a job for rhino compute… I mean there are components to run your gh function on you pc as a local server if you send them a request.

Thanks i will investigate. Do you have any resource to give me a quick start on this topic?

Hi @Quentin1

right now i sit here drink a coffee and try to figure it out by myself…unfortunatly i couldnt use your plugins to export…will test first if rhino compute spit out anything …if it works some information will follow.

if you get it to work i am interested to.

OK this should be what you need.
will test this later.

Thanks! Will investigate later as well and tell you if this worked