pyvista_cad.read_ifc#
- read_ifc(path, /, *, include=None, use_world_coords=True, **_)[source]#
Read an IFC file as a
pyvista.MultiBlock.Each IFC product with renderable geometry becomes one block. Block names follow
<element name>_<index>so they are unique even when names collide. Per-elementcad.guid,cad.ifc_type,cad.label, andcad.material(with optionalcad.color) field data are attached.- Parameters:
- pathstr or os.PathLike
Path to a
.ifcfile (IFC2X3 / IFC4 / IFC4X3).- includetuple of str or None, default: None
Restrict to specific IFC classes, e.g.
('IfcWall', 'IfcSlab'). WhenNone, every product with geometry is exported.- use_world_coordsbool, default: True
Apply each element’s local placement so the result is in world coordinates.
- **_Any
Forward-compat keyword arguments are accepted and ignored.
- Returns:
- pyvista.MultiBlock
Tessellated geometry, one block per element.
- Parameters:
- Return type:
Examples
Read the bundled small-building IFC fixture:
>>> import pyvista_cad >>> from pyvista_cad import read_ifc >>> mb = read_ifc(pyvista_cad.examples.small_building_ifc_path()) >>> type(mb).__name__ 'MultiBlock' >>> str(mb.field_data['cad.source_format'][0]) 'ifc'