SortPoints

Sorts an array of 3-D points.

Syntax

rhinoscriptsyntax.SortPoints (points, ascending=True, order=0)

rhinoscript.utility.SortPoints (points, ascending=True, order=0)

Parameters

points

Required.  Array.  An array of 3-D points.

ascending

Optional.  Boolean.  The sorting mode, either ascending or descending.  If omitted, the points are sorted ascending (True).

order

Optional.  Number.  The component sort order, where:

Value

Component Sort Order

0 (default)

X, Y, Z

1

X, Z, Y

2

Y, X, Z

3

Y, Z, X

4

Z, X, Y

5

Z, Y, X

Returns

List

A list of sorted 3-D points if successful.

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

points = rs.GetPoints()

if points:

    points = rs.SortPoints(points)

    for p in points: print p

Also See

SortStrings

SortNumbers