GetObjectsEx

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

Syntax

Rhino.GetObjectsEx ([strMessage [, intType [, blnGroup [, blnPreSelect [, blnSelect [, arrObjects [, intMin [, intMax ]]]]]]])

Parameters

strMessage

Optional.  String.  A prompt or message.

intType

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

Hex

Description

0

&h0

All objects

1

&h1

Point

2

&h2

Point cloud

4

&h4

Curve

8

&h8

Surface (single-face Brep or Extrusion)

16

&h10

Polysurface (multiple-face Brep or Extrusion)

32

&h20

Mesh

256

&h100

Light

512

&h200

Annotation

4096

&h1000

Instance (Block) reference

8192

&h2000

Text dot

16384

&h4000

Grip

32768

&h8000

Detail

65536

&h10000

Hatch

131072

&h20000

Morph control

134217728

&h8000000

Cage

268435456

&h10000000

Phantom

536870912

&h20000000

Clipping plane

1073741824

&h40000000

Extrusion

blnGroup

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

blnPreSelect

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

blnSelect

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.

arrObjects

Optional.  Array.  An array of strings identifying the objects that are allowed to be selected.

intMin

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

intMax

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 intMin of object selected. If >0, then the picking stops when there are intMax objects.  If a window pick, crossing pick, or Sel* command attempts to add more than intMax, then the attempt is ignored.

Returns

Array

An array that contains arrays of selection information if successful. The array of selection information will contain the following:

Element

Description

0

String. 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

Array. 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.

Null

If not successful, or on error.

Example

Dim arrObjects, arrObj

arrObjects = Rhino.GetObjectsEx("Select object", 0, True)

If IsArray(arrObjects) Then

  For Each arrObj In arrObjects

    Rhino.Print "Object id = " & arrObj(0)

    Rhino.Print "Object was preselected = " & CStr(arrObj(1))

    Select Case arrObj(2)

      Case 0

        Rhino.Print "Selection method = 0 (non-mouse)"

      Case 1

        Rhino.Print "Selection method = 1 (mouse)"

        Rhino.Print "Pick point = " & Rhino.Pt2Str(arrObj(3))

      Case 2

        Rhino.Print "Selection method = 1 (window)"

      Case 3

        Rhino.Print "Selection method = 1 (crossing)"

    End Select

    Rhino.Print "Active view = " & CStr(arrObj(4))

  Next

End If

Also See

GetCurveObject

GetObject

GetObjectEx

GetObjects

GetSurfaceObject