GetObjectsEx

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

Syntax

rhinoscriptsyntax.GetObjectsEx (message=None, filter=0, group=True, preselect=False, select=False, objects=None)

rhinoscript.selection.GetObjectsEx (message=None, filter=0, group=True, preselect=False, select=False, objects=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

Description

0

All objects (default)

1

Point

2

Point cloud

4

Curve

8

Surface or single-face brep

16

Polysurface or multiple-face

32

Mesh

256

Light

512

Annotation

4096

Instance or block reference

8192

Text dot object

16384

Grip object

32768

Detail

65536

Hatch

131072

Morph control

134217728

Cage

268435456

Phantom

536870912

Clipping plane

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.  A list of strings or Guids identifying the objects that are allowed to be selected.

Returns

List

A list that contains tuples of selection information if successful. The tuple of selection information will contain the following:

Element

Description

0

Guid. The identifier of the object.

1

Boolean. True if the object was pre-selected, otherwise False.

2

Number. The selection method:     

0: selected by non-mouse method (SelAll, etc.).

1: selected by mouse click on the object.

2: selected by being inside of a mouse window.

3: selected by intersecting a mouse crossing window.

3

Point3d. The selection point. This value is valid only if the object was not pre-selected and it was selected by clicking the mouse on the curve.

4

String. The name of the view in which the selection was made.

Example

import rhinoscriptsyntax as rs

objects = rs.GetObjectsEx("Select objects", 0, True)

for obj in objects:

    print "Object id = ", obj[0]

    print "Object was preselected = ", obj[1]

    if obj[2]==0:

        print "Selection method = 0 (non-mouse)"

    elif obj[2]==1:

        print "Selection method = 1 (mouse)"

        print "Pick point = ", obj[3]

    elif obj[2]==2:

        print "Selection method = 2 (window)"

    elif obj[2]==3:

        print "Selection method = 3 (crossing)"

    print "Active view = ", obj[4]

Also See

GetCurveObject

GetObject

GetObjectEx

GetObjects

GetSurfaceObject