set_block_name

MultiBlock.set_block_name(index: int, name: str)

Set a block’s string name at the specified index.

Parameters
indexint

Index or the dataset within the multiblock.

namestr

Name to assign to the block at index.

Examples

>>> import pyvista as pv
>>> data = {"cube": pv.Cube(), "sphere": pv.Sphere(center=(2, 2, 0))}
>>> blocks = pv.MultiBlock(data)
>>> blocks.append(pv.Cone())
>>> blocks.set_block_name(2, 'cone')
>>> blocks.keys()
['cube', 'sphere', 'cone']