pyvista.MultiBlock.get_index_by_name

pyvista.MultiBlock.get_index_by_name#

MultiBlock.get_index_by_name(name: str) int[source]#

Find the index number by block name.

Parameters:
namestr

Name of the block.

Returns:
int

Index of the block.

Examples

>>> import pyvista as pv
>>> data = {
...     'cube': pv.Cube(),
...     'sphere': pv.Sphere(center=(2, 2, 0)),
... }
>>> blocks = pv.MultiBlock(data)
>>> blocks.get_index_by_name('sphere')
1