pyvista_cad.CadMultiBlockAccessor.set_metadata#
- CadMultiBlockAccessor.set_metadata(*, units=None, label=None, color=None, transform=None, source_format=None, source_format_version=None, guid=None, metadata=None)[source]#
Write the standard
cad.*metadata onto this MultiBlock.Writes assembly-level metadata into the MultiBlock’s own field data (not recursively into the leaf blocks). Symmetric write side of the read-only metadata properties and the
metadataview; any previously storedcad.*schema key is cleared first.- Parameters:
- unitsstr, optional
Canonical length-unit string (
'mm','inch', …).- labelstr, optional
Assembly-level label.
- colortuple of float, optional
RGB 3-tuple or RGBA 4-tuple in
[0, 1]. Alpha rides on the color; there is no separate opacity key.- transformarray-like, optional
4x4assembly-local-to-world transform.- source_formatstr, optional
Originating CAD format (
'STEP','DXF', …).- source_format_versionstr, optional
Format-specific version stamp (e.g. a DXF release).
- guidstr, optional
Stable unique identifier (IFC
GlobalId, etc.).- metadatadict, optional
Free-form JSON-serializable bag stored under
cad.metadata.
- Raises:
- pyvista_cad.MetadataError
If
unitsis not a known unit,coloris not a 3- or 4-tuple in[0, 1],transformis not4x4, ormetadatais not a dict.
- Parameters:
- Return type:
None
Examples
>>> import pyvista as pv >>> import pyvista_cad >>> mb = pv.MultiBlock([pv.Sphere(), pv.Cube()]) >>> mb.cad.set_metadata(units='m', label='assembly') >>> mb.cad.units 'm'