It accepts nothing but still asks for option, I need that it should only read parameter if it’s provided, if it’s not then dont ask user about anything.
I guess he was trying to use RunScript to run a command with optional parameters… like this
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
Rhino.Input.Custom.GetString gs = new Rhino.Input.Custom.GetString();
gs.AcceptNothing(true);
gs.Get();
if (gs.CommandResult() != Rhino.Commands.Result.Success)
return gs.CommandResult();
string parameter = gs.StringResult();
if (string.IsNullOrEmpty(parameter))
{
MessageBox.Show("No parameter given");
return Rhino.Commands.Result.Cancel;
}
MessageBox.Show(parameter);
return Result.Success;
}
but his problem is that the Get() function waits an input but he dont always want to provide it… So if he use RhinoApp.RunScript(“MyCommand MyParameter”) everything is fine… but if he use RhinoApp.RunScript(“MyCommand”); the Get() function will wait an input.