SortPointList

 Sorts a list of 3-D points so they will be connected in "reasonable" polyline order.

Syntax

rhinoscriptsyntax.SortPointList (points, tolerance=None)

rhinoscript.utility.SortPointList (points, tolerance=None)

Parameters

points

Required.  List.  A list of 3-D points.

tolerance

Optional.  Number.  The minimum distance between points.  Points that fall within this tolerance will be discarded.  If omitted, Rhino's internal zero tolerance is used.

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.GetPointCoordinates()

if points:

    sorted = rs.SortPointList(points)

    rs.AddPolyline(sorted)

Also See

SortPoints