GetObjects

Prompts the user to pick or select one or more objects.

Syntax

rhinoscriptsyntax.GetObjects ( message=None, filter=0, group=True, preselect=False, select=False, objects=None, minimum_count=1, maximum_count=0, custom_filter=None )

rhinoscript.selection.GetObjects ( message=None, filter=0, group=True, preselect=False, select=False, objects=None, minimum_count=1, maximum_count=0, custom_filter=None )

Parameters

message

Optional.  String.  A prompt or message.

filter

Optional.  Number.  The type(s) of geometry objects (points, curves, surfaces, meshes, etc.) that can be selected.  Object types can be added together to filter several different kinds of geometry.

Value

Value (hex)

Description

0

0x0

All objects (default)

1

0x1

Point

2

0x2

Point cloud

4

0x4

Curve

8

0x8

Surface or single-face brep

16

0x10

Polysurface or multiple-face

32

0x20

Mesh

256

0x100

Light

512

0x200

Annotation

4096

0x1000

Instance or block reference

8192

0x2000

Text dot object

16384

0x4000

Grip object

32768

0x8000

Detail

65536

0x10000

Hatch

131072

0x20000

Morph control

134217728

0x8000000

Cage

268435456

0x10000000

Phantom

536870912

0x20000000

Clipping plane

1073741824

0x40000000

Extrusion

group

Optional.  Boolean.  Honor object grouping.  If omitted and the user picks a group, the entire group will be picked (True). Note, if filter is set to a value other than 0 (All objects), then group selection will be disabled.

preselect

Optional.  Boolean.  Allow for the selection of pre-selected objects.  If omitted, pre-selected objects are not accepted (False).

select

Optional.  Boolean.  Specifies whether or not the picked objects will remain selected when the function ends.  If omitted, objects that were pre-picked will remain selected and the objects that were post-picked will not be selected.

objects

Optional.  List. List of identifiers for objects that are allowed to be selected

minimum_count

Optional. Number. The minimum number of objects to select. If omitted, then at least one (1) object must be selected.

maximum_count

Optional. Number.  The maximum number of objects to select. If 0 (Default), then the user must press enter to finish object selection. If -1, then object selection stops as soon as there are at least minimum_count of object selected. If >0, then the picking stops when there are maximum_count objects.  If a window pick, crossing pick, or Sel* command attempts to add more than maximum_count, then the attempt is ignored.

custom_filter

Optional. Function that takes a Rhino Object, Geometry, and component index and returns true or false indicating if the object can be selected

Returns

list

A list of Guids identifying the picked objects if successful.

Example

import rhinoscriptsyntax as rs

objectIds = rs.GetObjects("Pick some curves", rs.filter.curve)

for id in objectIds: print "Object identifier:", id

Also See

GetCurveObject

GetObject

GetSurfaceObject