protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            var conduit = new SampleCsGetMultiplePointsConduit {
                Enabled = true
            };

            Result rc;

            var gp = new GetPoint();

            while (true)
            {
                if (0 == conduit.PointCount)
                {
                    gp.SetCommandPrompt("Location of point object.");
                    gp.AcceptNothing(false);
                    gp.AcceptUndo(false);
                }
                else
                {
                    gp.SetCommandPrompt("Location of point object. Press Enter when done");
                    gp.AcceptNothing(true);
                    gp.AcceptUndo(true);
                }

                var res = gp.Get();

                if (res == GetResult.Point)
                {
                    conduit.AddPoint(gp.Point());
                    doc.Views.Redraw();
                }
                else if (res == GetResult.Undo)
                {
                    conduit.RemoveLastPoint();
                    doc.Views.Redraw();
                }
                else if (res == GetResult.Nothing)
                {
                    rc = Result.Success;
                    break;
                }
                else
                {
                    rc = Result.Cancel;
                    break;
                }
            }

            if (rc == Result.Success && conduit.PointCount > 0)
            {
                doc.Objects.AddPoints(conduit.Points);
            }

            conduit.Enabled = false;
            doc.Views.Redraw();

            return(rc);
        }
        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            SampleCsGetMultiplePointsConduit conduit = new SampleCsGetMultiplePointsConduit();

            conduit.Enabled = true;

            Rhino.Commands.Result rc = Result.Nothing;

            Rhino.Input.Custom.GetPoint gp = new Rhino.Input.Custom.GetPoint();
            while (true)
            {
                if (0 == conduit.PointCount)
                {
                    gp.SetCommandPrompt("Location of point object.");
                    gp.AcceptNothing(false);
                    gp.ClearCommandOptions();
                }
                else
                {
                    gp.SetCommandPrompt("Location of point object. Press Enter when done");
                    gp.AcceptNothing(true);
                    gp.AddOption("Undo");
                }

                Rhino.Input.GetResult res = gp.Get();

                if (res == Rhino.Input.GetResult.Point)
                {
                    conduit.AddPoint(gp.Point());
                    doc.Views.Redraw();
                }
                else if (res == Rhino.Input.GetResult.Option)
                {
                    conduit.RemoveLastPoint();
                    doc.Views.Redraw();
                }
                else if (res == Rhino.Input.GetResult.Nothing)
                {
                    rc = Rhino.Commands.Result.Success;
                    break;
                }
                else
                {
                    rc = Rhino.Commands.Result.Cancel;
                    break;
                }
            }

            if (rc == Result.Success && conduit.PointCount > 0)
            {
                doc.Objects.AddPoints(conduit.Points);
            }

            conduit.Enabled = false;
            doc.Views.Redraw();

            return(rc);
        }