GetRectangle

Pauses for user input of a rectangle.

Syntax

rhinoscriptsyntax.GetRectangle (mode=0, base_point=None, prompt1=None, prompt2=None, prompt3=None)

rhinoscript.userinterface.GetRectangle (mode=0, base_point=None, prompt1=None, prompt2=None, prompt3=None)

Parameters

mode

Optional.  Number.  The rectangle selection mode.  If not specified, all modes (0) are available.  The rectangle selection modes are as follows:

Value

Description

0

All modes.

1

Corner.  A rectangle is created by picking two corner points.

2

3-Point.  A rectangle is created by picking three points

3

Vertical.  A vertical rectangle is created by picking three points.

4

Center.  A rectangle is created by picking a center point and a corner point.

base_point

Optional.  List of 3 numbers of a Point3d.  A 3-D base point.

prompt1

Optional.  String.  The first prompt or message.

prompt2

Optional.  String.  The second prompt or message.

prompt3

Optional.  String.  The third prompt or message.  The third prompt used only with 3Point and Vertical modes.

Returns

Tuple

A tuple of four 3-D points that define the corners of the rectangle if successful.  Points are returned in counter-clockwise order.  See the image below for details.

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

rect = rs.GetRectangle()

if rect:

    for i, corner in enumerate(rect):

        rs.AddTextDot( i, corner )

 

Also See

GetPoint

GetPoints