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

Function edit_qtos

src/ifc5d/ifc5d/qto.py:130–139  ·  view source on GitHub ↗

Apply quantification results as quantity sets.

(ifc_file: ifcopenshell.file, results: ResultsDict)

Source from the content-addressed store, hash-verified

128
129
130def edit_qtos(ifc_file: ifcopenshell.file, results: ResultsDict) -> None:
131 """Apply quantification results as quantity sets."""
132 for element, qtos in results.items():
133 for name, quantities in qtos.items():
134 qto = ifcopenshell.util.element.get_pset(element, name, should_inherit=False)
135 if qto:
136 qto = ifc_file.by_id(qto["id"])
137 else:
138 qto = ifcopenshell.api.pset.add_qto(ifc_file, element, name)
139 ifcopenshell.api.pset.edit_qto(ifc_file, qto=qto, properties=quantities)
140
141
142class SI2ProjectUnitConverter:

Callers 1

run_quantifyFunction · 0.90

Calls 2

itemsMethod · 0.45
by_idMethod · 0.45

Tested by

no test coverage detected