Serialize an element to a compact reference dict.
(element: ifcopenshell.entity_instance)
| 27 | |
| 28 | |
| 29 | def _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 | |
| 37 | def _ref_or_none(element: ifcopenshell.entity_instance | None) -> dict[str, Any] | None: |
no test coverage detected