Serialize an entity instance to a summary dict.
(entity: ifcopenshell.entity_instance)
| 138 | |
| 139 | |
| 140 | def _serialize_entity(entity: ifcopenshell.entity_instance) -> dict: |
| 141 | """Serialize an entity instance to a summary dict.""" |
| 142 | result = { |
| 143 | "id": entity.id(), |
| 144 | "type": entity.is_a(), |
| 145 | } |
| 146 | if hasattr(entity, "Name") and entity.Name: |
| 147 | result["name"] = entity.Name |
| 148 | return result |
no test coverage detected