Does not execute method

Hi All,

def Sel_Ln():
    rt, obj_ref2 = RhinoGet.GetOneObject("Sel Ln", False, ObjectType.Curve)
    print "sel_rtt"

def Sel_Crv_Cls():
    cc, obj_ref1 = RhinoGet.GetOneObject("Sel Crv Cls", False, ObjectType.Curve)
    if (cc != Result.Success):
        Get_Ln()
    else:
        Sel_Ln()

Sel_Crv_Cls()

how come once you start the first def Sel_Crv_Cls()
if the result is the same as success, the second def Sel_Ln() starts

is printed “sel_rtt”
but the method: RhinoGet.GetOneObject("Sel Ln", False, ObjectType.Curve)
is not executed?

def Sel_Crv_Cls():
    cc1, obj_ref1 = RhinoGet.GetOneObject("Sel Crv Cls", False, ObjectType.Curve)

    cc2, obj_ref2 = RhinoGet.GetOneObject("Sel Crv Cls", False, ObjectType.Curve)

you cannot request the method twice. . .
. . .with identical signature

Try this:

import Rhino
import scriptcontext as sc

def test():
    go = Rhino.Input.Custom.GetObject()
    go.SetCommandPrompt("Select first curve")
    go.GeometryFilter = Rhino.DocObjects.ObjectType.Curve
    go.Get()
    if go.CommandResult() != Rhino.Commands.Result.Success:
        return go.CommandResult()
        
    curve0 = go.Object(0).Curve()
    if not curve0:
        return
        
    go.SetCommandPrompt("Select second curve")
    go.EnablePreSelect(False, True)
    go.DeselectAllBeforePostSelect = False
    go.Get()
    if go.CommandResult() != Rhino.Commands.Result.Success:
        return go.CommandResult()
        
    curve1 = go.Object(0).Curve()
    if not curve1:
        return
        
    # TODO...

if __name__ == "__main__":        
    test()

– Dale

Dale Great, thanks.

:+1: