Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Python Esc cancel does not work in rhino 6 osx

$
0
0

Trying to make a cancel-able python script on mac in rhino 6.
script:

import rhinoscriptsyntax as rs
import Rhino
def TimeConsumingTask():

    for i in range(10000):
        # Was escape key pressed?
        Rhino.RhinoApp.Wait()
        rs.Sleep(1)
        if (scriptcontext.escape_test(False)):
            print "TimeConsumingTask cancelled."
            break
        print i
TimeConsumingTask()

I found these commands to try and help escape_test be detected, but no luck.

Rhino.RhinoApp.Wait()
        rs.Sleep(1)

Anybody have a fix for this or should it be reported as a bug?
Cheers

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles