pyvista.MultiBlock.append#
- MultiBlock.append(
- dataset: MultiBlock | DataSet | None,
- name: str | None = None,
Add a data set to the next block index.
- Parameters:
- dataset
pyvista.DataSet
orpyvista.MultiBlock
Dataset to append to this multi-block.
- name
str
,optional
Block name to give to dataset. A default name is given depending on the block index as
'Block-{i:02}'
.
- dataset
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']