GetSurfaceObject

Prompts the user to pick, or select, a single surface object.

Syntax

rhinoscriptsyntax.GetSurfaceObject (message="select surface", preselect=False, select=False)

rhinoscript.selection.GetSurfaceObject (message="select surface", preselect=False, select=False)

Parameters

message

Optional.  String.  A prompt or message.

preselect

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

select

Optional.  Boolean.  Select the picked objects.  If omitted, the objects that are picked are not selected (False).

Returns

Tuple

A tuple of selection information if successful. The tuple will contain the following information:

Element

Description

0

Guid. The identifier of the surface object.

1

Boolean. True if the surface 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 surface was not pre-selected and it was selected by clicking the mouse on the surface.

4

tuple. The u,v surface parameter of the selection point. This value is valid only if the surface was not pre-selected and it was selected by clicking the mouse on the surface.

5

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

None

If no object picked

Example

import rhinoscriptsyntax as rs

select = rs.GetSurfaceObject("Select surface")

if select:

    print "Surface identifier: ", select[0]

Also See

GetCurveObject

GetObject

GetObjects