Enable picking of cells with a rectangle selection tool.

Press "r" to enable rectangle based selection. Press "r" again to turn it off. Selection will be saved to self.picked_cells.

All meshes in the scene are available for picking by default. If you would like to only pick a single mesh in the scene, use the pickable=False argument when adding the other meshes to the scene.

When multiple meshes are being picked, the picked cells in self.picked_cells will be a MultiBlock dataset for each mesh’s selection.

Uses last input mesh for input by default.


Visible cell picking (through=False) will only work if the mesh is displayed with a 'surface' representation style (the default).

callbackcallable(), optional

When input, calls this callable after a selection is made. The picked_cells are input as the first parameter to this callable.

throughbool, default: True

When True the picker will select all cells through the mesh(es). When False, the picker will select only visible cells on the selected surface(s).

showbool, default: True

Show the selection interactively.

show_messagebool | str, default: True

Show the message about how to use the cell picking tool. If this is a string, that will be the message shown.

stylestr, default: “wireframe”

Visualization style of the selection. One of the following: style='surface', style='wireframe', or style='points'.

line_widthfloat, default: 5.0

Thickness of selected mesh edges.

colorColorLike, default: “pink”

The color of the selected mesh when shown.

font_sizeint, default: 18

Sets the font size of the message.

startbool, default: True

Automatically start the cell selection tool.

show_frustumbool, default: False

Show the frustum in the scene.

**kwargsdict, optional

All remaining keyword arguments are used to control how the selection is interactively displayed.


Add a mesh and a cube to a plot and enable cell picking.

>>> import pyvista as pv
>>> mesh = pv.Sphere(center=(1, 0, 0))
>>> cube = pv.Cube()
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(mesh)
>>> _ = pl.add_mesh(cube)
>>> _ = pl.enable_cell_picking()