Resource work duration can now be calculated based on counting produced products.

This commit is contained in:
Dion Moult
2021-09-20 13:27:22 +10:00
parent e2b5ecf0a1
commit 70ba681b35
2 changed files with 31 additions and 7 deletions
@@ -48,12 +48,12 @@ class Usecase:
for rel2 in rel.RelatingProcess.HasAssignments or []:
if not rel2.is_a("IfcRelAssignsToProduct"):
continue
psets = ifcopenshell.util.element.get_psets(rel2.RelatingProduct)
for pset in psets.values():
for name, value in pset.items():
if name == self.unit_produced_name:
try:
if self.unit_produced_name == "Count":
total += 1
else:
psets = ifcopenshell.util.element.get_psets(rel2.RelatingProduct)
for pset in psets.values():
for name, value in pset.items():
if name == self.unit_produced_name:
total += float(value)
except:
pass
return total