hello,
in a script i would like to use Rhino.Input.Custom.Option
but with a string and not integer or other.
for example the custom option default is Up, so the command line offers three other choice:
Down, Left and Rhight,
if i clic ‘Down’, the command line will change and offers the three other choice, Up,Left and Right…
is it possible?
Maybe this helps?
def CommandLineOptions(prompt,msg,choices,ini):
go = Rhino.Input.Custom.GetOption()
go.SetCommandPrompt(prompt)
lstOption = go.AddOptionList(msg,choices,ini)
go.AcceptNothing(True)
index=ini
while True:
get_rc = go.Get()
if go.CommandResult()== Rhino.Commands.Result.Cancel:
return
elif go.CommandResult()== Rhino.Commands.Result.Nothing:
break
elif get_rc==Rhino.Input.GetResult.Option:
if go.OptionIndex()==lstOption:
index = go.Option().CurrentListOptionIndex
continue
break
return index
#get command line options
prompt="Options:"
msg="OptionOne"
ini=0
choices=["A","B","C","D","E"]
options=CommandLineOptions(prompt,msg,choices,ini)
It’s not really that i search…
for selection it need Two clics…
i’ll try with this!
thank’s!