public static Commands.Result GetMultipleObjects(string prompt, bool acceptNothing, Rhino.DocObjects.ObjectType filter, out Rhino.DocObjects.ObjRef[] rhObjects) { rhObjects = null; Rhino.Input.Custom.GetObject go = new Rhino.Input.Custom.GetObject(); go.SetCommandPrompt(prompt); go.AcceptNothing(acceptNothing); go.GeometryFilter = filter; go.GetMultiple(1, 0); //David: changed this from GetMultiple(1, -1), which is a much rarer case (imo). Commands.Result rc = go.CommandResult(); if (rc == Rhino.Commands.Result.Success && go.ObjectCount > 0) { rhObjects = go.Objects(); } go.Dispose(); return rc; }
public static Commands.Result GetOneObject(string prompt, bool acceptNothing, Rhino.DocObjects.ObjectType filter, out Rhino.DocObjects.ObjRef rhObject) { rhObject = null; Rhino.Input.Custom.GetObject go = new Rhino.Input.Custom.GetObject(); go.SetCommandPrompt(prompt); go.AcceptNothing(acceptNothing); go.GeometryFilter = filter; go.Get(); Commands.Result rc = go.CommandResult(); if (rc == Rhino.Commands.Result.Success && go.ObjectCount > 0) { rhObject = go.Object(0); } go.Dispose(); return rc; }