pyvista_cad.CadMultiBlockAccessor.find

pyvista_cad.CadMultiBlockAccessor.find#

CadMultiBlockAccessor.find(predicate=None, *, name=None, ifc_type=None, layer=None, source_format=None)[source]#

Filter the MultiBlock tree.

Parameters:
predicatestr, callable, or None, optional
  • str: glob-style pattern matched against block labels (cad.label or the trailing path name).

  • callable: (path, block) -> bool.

  • None: ignored — fall back to the keyword predicates.

name, ifc_type, layer, source_formatstr, optional

Exact-match metadata filters (AND-combined). Each defaults to None (do not filter).

Returns:
list of (str, pyvista.DataSet)

Matching (path, block) pairs.

Parameters:
Return type:

list[tuple[str, DataSet]]

Examples

>>> import pyvista as pv
>>> import pyvista_cad
>>> mb = pv.MultiBlock({'wheel': pv.Sphere(), 'axle': pv.Cube()})
>>> [name for name, _ in mb.cad.find(predicate='whe*')]
['wheel']