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

Method __getitem__

src/ifcopenshell-python/ifcopenshell/file.py:821–825  ·  view source on GitHub ↗
(self, key: Union[numbers.Integral, str, bytes])

Source from the content-addressed store, hash-verified

819 return getattr(self.wrapped_data, attr)
820
821 def __getitem__(self, key: Union[numbers.Integral, str, bytes]) -> entity_instance:
822 if isinstance(key, numbers.Integral):
823 return entity_instance(self.wrapped_data.by_id(key), self)
824 elif isinstance(key, (str, bytes)):
825 return entity_instance(self.wrapped_data.by_guid(str(key)), self)
826
827 def by_id(self, id: int) -> ifcopenshell.entity_instance:
828 """Return an IFC entity instance filtered by IFC ID.

Callers

nothing calls this directly

Calls 3

entity_instanceClass · 0.90
by_idMethod · 0.45
by_guidMethod · 0.45

Tested by

no test coverage detected