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

Function _ref

src/ifcquery/ifcquery/relations.py:29–34  ·  view source on GitHub ↗

Serialize an element to a compact reference dict.

(element: ifcopenshell.entity_instance)

Source from the content-addressed store, hash-verified

27
28
29def _ref(element: ifcopenshell.entity_instance) -> dict[str, Any]:
30 """Serialize an element to a compact reference dict."""
31 result: dict[str, Any] = {"id": element.id(), "type": element.is_a()}
32 if hasattr(element, "Name") and element.Name:
33 result["name"] = element.Name
34 return result
35
36
37def _ref_or_none(element: ifcopenshell.entity_instance | None) -> dict[str, Any] | None:

Callers 4

_ref_or_noneFunction · 0.70
_ref_listFunction · 0.70
_traverse_upFunction · 0.70
_all_relationsFunction · 0.70

Calls 2

idMethod · 0.45
is_aMethod · 0.45

Tested by

no test coverage detected