@nathanletwory wrote:
I have code that looks like this:
protected override Result RunCommand(RhinoDoc doc, RunMode mode) { var gopt = new GetOption(); // from Rhino.Input.Custom int disableIdx = gopt.AddOption("Pause"); int enableIdx = gopt.AddOption("Unpause"); int toggleIdx = gopt.AddOption("Toggle"); gopt.SetCommandPrompt("Action"); gopt.Get(); // PROBLEM // we never get here if we press Pause or type Pause as the option Result rc = gopt.CommandResult(); if (rc == Result.Success && gopt.Result() == Rhino.Input.GetResult.Option) { CommandLineOption clo = gopt.Option(); // here some useful code } return Result.Nothing; }
It appears that using the option
Pause
doesn’t work since there is already a command calledPause
. Is there a setting onGetOption()
that prevents commands from taking precedence, or how can I ensure I can use option names that look like existing commands?A similar problem happens when I use the string
Lock
(forLock
andUnlock
as options).
Posts: 2
Participants: 1