pyvista.MultiBlock.append#

MultiBlock.append(
dataset: MultiBlock | DataSet | None,
name: str | None = None,
)[source]#

Add a data set to the next block index.

Parameters:
datasetpyvista.DataSet or pyvista.MultiBlock

Dataset to append to this multi-block.

namestr, optional

Block name to give to dataset. A default name is given depending on the block index as 'Block-{i:02}'.

Examples

>>> import pyvista as pv
>>> from pyvista import examples
>>> data = {
...     "cube": pv.Cube(),
...     "sphere": pv.Sphere(center=(2, 2, 0)),
... }
>>> blocks = pv.MultiBlock(data)
>>> blocks.append(pv.Cone())
>>> len(blocks)
3
>>> blocks.append(examples.load_uniform(), "uniform")
>>> blocks.keys()
['cube', 'sphere', 'Block-02', 'uniform']