I used the Google Chrome browser and I right-clicked on the page then “Translate to French” and Google Translate translated all the page. Then when I had “reply to” that put the translated quote (by Google Translate Integrated to Google Chrome)
Hi,
Focusing on the issue of simply showing when GH is working on a solution rather than showing the progress in percent, is there a way of doing this if I have an Eto form that would give the information?
My old solution for this is to use the Rhino command row (RhinoApp.WriteLine), which can pump out messages during a GH solution.
I can print something like ‘GH processing…’ that gets triggered by the SolutionStart event in GH and then ‘GH done!’ by the SolutionEnd event.
Technically this does what I want (and can be used to show how far along a long loop I am), but if I can’t see the command row in Rhino when triggering the calculation (for instance if the GH window is above it) I won’t see this info.
Additionally this is a very discrete way of visual feedback, I would rather have a spinner or something that changes color to highlight that a calculation is running and that GH/Rhino will be unresponsive.
I’ve been playing with Eto lately and it feels like there should be a way to do this there (correct me if I’m wrong).
If I create an Eto form (a simple interface for my GH-script) and save it to sticky, I can interact with my GH-document very well.
What I then want is for instance to set the background color of the form based on the solution status in GH, that would be a very visible indicator.
I can have a function that sets it to green upon the SolutionEnd event, this works. But where I struggle is to set it to red right before the solution starts.
If i listen to the SolutionStart event for this it works for printing to the Rhino Command row, but updating the eto.form happens only after the solution (presumably because SolutionStart happens after GH has started to hog the UI thread?).
Are there other events that fire before GH starts to block everything, where I can set the form color right before the solution starts?
Perhaps above is more an Eto question than a GH one…
@curtisw, what I’m trying to do is change something in my form before a GH-solution, for instance the color of a control. If I do this by using a button that first triggers the color change method and then triggers something in GH, the problem is that I will only se the color change in the form after the GH-solution finishes.
I don’t fully get the threading of an Eto form saved to Sticky… Is this because the Eto color change and the GH-calculation both run on the same thread, and both get queued by my button (and only after both have finished will it update the UI?).
Can i trigger the Eto form to update/redraw while the GH solution is running in some way?
The problem you might be running into is that the UI can’t update if the UI thread is blocked, and since the SolutionStart event immediately precedes the solution being solved there’s no time in the run loop to do the actual work. One thing that might help is to call Application.Instance.RunIteration()
after setting the background color, which should give the main loop some time to do the work it needs to do.
Hope this helps!
Thanks! The description of that function seems like exactly what I’m looking for!
(apart from the warning that it’s not recommended to use )
I can’t seem to find the Application to run the method on though, I’m doing this in Python and none of the Python examples I find work with the Application that is created when making a form (I assume it’s created because trying to do it manually tells me it’s already been created)
Nevermind @curtisw, I found it and your solution works! Many thanks!