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();
}
}
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;
}