Choose the default option

@software_comas, i’ve been using this way to do it:

Set go.AcceptNumber(True, False) to allow entering a number and put the code to setup command options in a seperate function eg. in below example this function is named SetCommandOptions(). Then you can clear the command options after a number has been entered and run that function again eg:

while True:
    SetCommandOptions()
    get_rc = go.Get()
    if go.CommandResult() == Rhino.Commands.Result.Cancel:
        return
    if get_rc == Rhino.Input.GetResult.Option:
        option_name = go.Option().EnglishName
        # do something here if required
    elif get_rc == Rhino.Input.GetResult.Number:
        # set the entered number as current value for an option
        optSize.CurrentValue = go.Number()
        go.ClearCommandOptions()
        SetCommandOptions()
    else:
        break

_
c.

1 Like