Prompts the user to pick, or select, a single object.
rhinoscriptsyntax.GetObjectEx (message=None, filter=0, preselect=False, select=False, objects=None)
rhinoscript.selection.GetObjectEx (message=None, filter=0, preselect=False, select=False, objects=None)
message |
Optional. String. A prompt or message. |
||||||||||||||||||||||||||||||||||||||
filter |
Optional. Number. The type or types 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.
|
||||||||||||||||||||||||||||||||||||||
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 Guids identifying the objects that are allowed to be selected. |
Tuple |
A tuple of selection information if successful. The tuple will contain the following information:
|
||||||||||||
None |
If no object picked |
import rhinoscriptsyntax as rs
obj = rs.GetObjectEx("Select object", 0, True)
if obj:
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]