Unable to get a valid rectangle using getObject().pickRectangle ()

Hello:

I used RHINO7.0SR16 and the code is as follows:

Public class Examples
{

Public Rectangle GetRectangle()

  {

    var go = new GetObject();

    go.SetCommandPrompt("Select point");

     go.GeometryFilter = ObjectType.Point;

     go.GetMultiple(1, 0);

    var rec =go.PickRectangle();

   }

}

Unable to get a valid rectangle.

thanks.

Hi @401247906,

How about this?

protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
  var rc = RhinoGet.GetRectangle(out var corners);
  if (rc == Result.Success)
  {
    var polyline = new Polyline(corners);
    polyline.Add(polyline[0]); // close
    doc.Objects.AddPolyline(polyline);
    doc.Views.Redraw();
  }
  return rc;
}

– Dale