Galapagos with scripted components - solution problems

Hi all,

I am launching an exe via process.start() and doing some importing an exporting of geometry via RhinoApp.RunScript() all within a C# scripting component in Grasshopper.

This all works fine under normal circumstances, however when I introduce something like Galapagos I run into problems with objects expiring warnings etc. And when everything stops working it seems to be my scripting component that breaks, as it doesn’t output the required data.

I actually think it may be the RunScript import instead of the process.start but something isn’t working right. Could there possibly be problems with Rhino not waiting for RunScript to complete before executing the rest of the script? But why would this only happen during the Galapagos run? Strange!

Thank you in advance.

If your external application runs without blocking Grasshopper, then galapagos will start the next solution, and then the next, while your exe is still calculating things.

I don’t know if this is what is happening, but it does sound likely given the Process.Start method.

How do you get the data back from the external app?

Thanks for your response. I use the Process.WaitForExit method which should block grasshopper, after this is complete a step file is passed back into Rhino and then Grasshopper using import and collecting from layers.

The fact that my script works under normal circumstances (without Galapagos) would suggest that this component is working as it should.

I admit that it is a very convoluted method (bake, export, change the geometry in another program using an API, import, collect from layers) but it is necessary in my case.