I’m trying to run a Grasshopper solution from LinqPad but it never seems to do anything.
async void Main()
{
var core = startRhino();
core.Run(); // Is this needed?
var arch = new GH_IO.Serialization.GH_Archive();
arch.ReadFromFile("script.gh");
doc = new GH_Document();
using (doc)
{
if (!arch.ExtractObject(doc, "Definition"))
throw new Exception();
doc.SolutionStart += solutionStart;
doc.SolutionEnd += solutionEnd;
doc.ScheduleSolution(0, scheduleDelegate);
}
}
Per advice given elsewhere I set input parameters in scheduleDelegate and compute outputs in solutionEnd.
But solutionStart, solutionEnd and the scheduleDelegate never get called and the LinqPad script just exits. Is scheduleSolution starting the solution in another thread and my script exits before it gets to do anything. I did try polling ScheduleProgress but it always remained at 0.
Am I missing something here or is this completely the wrong way of going about this? There doesn’t seem to be any documentation on the matter.