Open dantaeyoung opened 10 years ago
You can code in an Esc break: http://www.grasshopper3d.com/forum/topics/make-a-custom-component-cancel-able?commentId=2985220%3AComment%3A883361 , introduced to me by @mostaphaRoudsari .
You can see an example for Python here, I used it for one of the Ladybug components: https://github.com/mostaphaRoudsari/ladybug/blob/master/src/Ladybug_SolarFan_alt.py#L801
ETA: It looks like it will work as long as you embed it within a loop, but not for recursive calls.
@saeranv the link above is broken, where can I find this?
Hi,
First of all, thanks for such a wonderful and helpful script.
It seems that right now, there's no way to break or Ctrl-C a Python script -- for example, an infinite "while(True)" loop will run forever, consequently crashing Rhino. Of course, I'm not running infinite loops, but this means that a loop with faulty logic will crash Rhino and Grasshopper, erasing any progress done since the last time saved.
Am I missing something, and is there a way to just break a Python script running inside the Python Grasshopper Component?