Vizard 7 » Command Index » Vizard objects » window » <window>.pickRect
7.6

<window>.pickRect

Pick all nodes within a rectangular area

<window>.pickRect(  
rect  
mode = viz.WORLD  
eye = viz.BOTH_EYE  
)  
rect
The [left,bottom,right,top] coordinates of the rectangular area, in normalized screen units.
mode = viz.WORLD
This flag specifies whether to perform the pick operation on the world or screen. This can be either viz.WORLD or viz.SCREEN
eye = viz.BOTH_EYE
The eye to perform the picking on. Can be viz.BOTH_EYE, viz.LEFT_EYE, viz.RIGHT_EYE. If stereo mode is enabled, the command will automatically adjust the pick coordinates for the specified eye.

Remarks

This command will return all nodes that either fully or partially appear within the specified rectangular area.

Nodes that have viz.PICKING disabled will not appear in the results.

Return Value

List of <node3d> objects

Example

# Define a rectangle centered in the window
rect = [0.25,0.25,0.75,0.75]

# Get all nodes within the rectangle
picked = viz.MainWindow.pickRect(rect)
for node in picked:
    print(node)

See also

<window>.pick