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

GetObject weird behavior

$
0
0

Hi,

Weird behavior of Rhino.Input.Custom.GetObject in python.

If I run this :

import Rhino

#

def getObject() :
    go = Rhino.Input.Custom.GetObject()
    go.Get()
    if go.CommandResult() != Rhino.Commands.Result.Success: return False
    guid = go.Object(0)
    return guid

#

counter = 5

while getObject() and counter > 0 :
    print counter
    counter -= 1

I would expect my getObject function to run 5 times, each time prompting the user to select an object. Instead it does wait for user selection the first time, then the subsequent 4 times getObject resolves without waiting for user input.

Am I overlooking something here ? I want getObject to run indefinitely until the user presses escape, each time processing a different object.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4171

Latest Images

Trending Articles



Latest Images