MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / _material_to_dict

Function _material_to_dict

src/ifcquery/ifcquery/info.py:177–187  ·  view source on GitHub ↗

Convert a material entity to a summary dict.

(material: ifcopenshell.entity_instance | None)

Source from the content-addressed store, hash-verified

175
176
177def _material_to_dict(material: ifcopenshell.entity_instance | None) -> dict[str, Any] | None:
178 """Convert a material entity to a summary dict."""
179 if material is None:
180 return None
181 result: dict[str, Any] = {
182 "id": material.id(),
183 "type": material.is_a(),
184 }
185 if hasattr(material, "Name"):
186 result["name"] = material.Name
187 return result
188
189
190def info(model: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:

Callers 1

infoFunction · 0.85

Calls 2

idMethod · 0.45
is_aMethod · 0.45

Tested by

no test coverage detected