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

Method create_iterators

src/ifc5d/ifc5d/qto.py:377–390  ·  view source on GitHub ↗
(
        ifc_file: ifcopenshell.file, settings: ifcopenshell.geom.settings, elements: list[ifcopenshell.entity_instance]
    )

Source from the content-addressed store, hash-verified

375
376 @staticmethod
377 def create_iterators(
378 ifc_file: ifcopenshell.file, settings: ifcopenshell.geom.settings, elements: list[ifcopenshell.entity_instance]
379 ) -> list[Union[ifcopenshell.geom.iterator, IteratorForTypes]]:
380 elements_sorted: defaultdict[bool, list[ifcopenshell.entity_instance]] = defaultdict(list)
381 iterators = []
382 for element in elements:
383 elements_sorted[element.is_a("IfcTypeProduct")].append(element)
384 if True in elements_sorted:
385 iterators.append(IteratorForTypes(ifc_file, settings, elements_sorted[True]))
386 if False in elements_sorted:
387 iterators.append(
388 ifcopenshell.geom.iterator(settings, ifc_file, multiprocessing.cpu_count(), include=elements)
389 )
390 return iterators
391
392 @classmethod
393 def get_segment_length(cls, element: ifcopenshell.entity_instance) -> Union[float, None]:

Callers 1

calculateMethod · 0.80

Calls 4

IteratorForTypesClass · 0.85
appendMethod · 0.45
is_aMethod · 0.45
iteratorMethod · 0.45

Tested by

no test coverage detected