How to esc from a GH loop

Hi everyone ,

I have a problem every now and then with the GH file going into a loop ( Not Responding ) when I’m changing to a number that is I guess not feasible . GH tries to calculate indefinitely and I can’t escape from it without closing Rhino and losing my progress .
I would love to just “end task” on GH and not lose my Rhino progress .
Can anyone help
Thanks in advance

This issue has been discussed here before. Here’s my list of steps to minimize the effect of a GH loop:

  1. Use Task Manager to close Rhino.
  2. Restart Rhino & GH
  3. Open the GH Special Folders/Recovery File directory. There should be at least 1 file with a long name in there. There will probably be a number of files. Open the top file.
  4. You’ll see your GH file at the last step before the change you made that created the loop. SO don’t make that change again - or else you’ll repeat the whole experience.
  5. Instead, do something different - presumably something that doesn’t create another loop.
  6. Use File/Save As to give the newly resurrected GH file the same name and location as your original file - i. e., over-write the one that looped with the new one.

Thank you Birk ,

That is my issue , I’m not worried about the GH file because when I re-open it , it always gives me the option to open the recovery file , It’s more the Rhino file that I’m worried about , even-though I have Autosave set-up for 15 minutes , I usually end up losing the work up to my last “manual” Save .

“loop”? Are you using some script or plugin like anemone? kangaroo?
Otherwise grasshopper doesn’t have ways to do loops.
It should always be possible to wait a lot of time and the calculation should meet an end.
But I agree with you that this is not a solution.


That’s the main problem, you should expect and foresee any combinations of inputs in your definitions.
This is not simple, surely time and experience is the main key…

See this example:
2022-05-21 12_05_16-Window
In this simple code, the slider goes from 0.000 to 1.000.
This is a risk! Because changing the slider near 0.000 will surely generate a very high point count.
Even this simple code can take 100ms to compute, now imagine you had something else after the Divide Length component: you’ll have to wait seconds, guaranteed.
Solution?
You know what is that slider for, and you know what your design scale is.
Make it go from 0.100 to 1.000 !
(Sometime using a panel to input numbers is even better…)

This is a very simple example, but you should try to extend this concept to your whole definition.
Know your code and limit its chances to go into a nonsensical big computation.

Also, save more frequently your rhino file :sweat_smile:

A pain, I agree. I use the component “data dam” before an input to a time intensive loop, so I can check the progress/validity of other parameters before GH does a full calculation, working on one now where each iteration, if all is well, can be 10 or 12 minutes, and overnight if not