Skip to content
This repository was archived by the owner on Jan 6, 2021. It is now read-only.
This repository was archived by the owner on Jan 6, 2021. It is now read-only.

No way to break/Ctrl-C out of python script #68

Open

Description

@dantaeyoung

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?

Activity

  1. saeranv commented on Jun 29, 2014

    @saeranv

    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.

  2. chojje commented on Apr 6, 2018

    @chojje

    @saeranv the link above is broken, where can I find this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions