pyvista.MultiBlock.get#
- MultiBlock.get(
- index: str,
- default: MultiBlock | DataSet | None = None,
Get a block by its name.
If the name is non-unique then returns the first occurrence. Returns
default
if name isn’t in the dataset.- Parameters:
- index
str
Index or name of the dataset within the multiblock.
- default
pyvista.DataSet
orpyvista.MultiBlock
,optional
Default to return if index is not in the multiblock.
- index
- Returns:
pyvista.DataSet
orpyvista.MultiBlock
orNone
Dataset from the given index if it exists.
Examples
>>> import pyvista as pv >>> from pyvista import examples >>> data = {'poly': pv.PolyData(), 'img': pv.ImageData()} >>> blocks = pv.MultiBlock(data) >>> blocks.get('poly') PolyData ... >>> blocks.get('cone')