mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 14:33:28 +00:00
Proposal to use parent productivity to calculate resource work.
This commit is contained in:
committed by
Dion Moult
parent
97327dbc13
commit
b09e19dc8a
@@ -63,7 +63,17 @@ class Usecase:
|
|||||||
self.settings["resource"]
|
self.settings["resource"]
|
||||||
).get("EPset_Productivity", None)
|
).get("EPset_Productivity", None)
|
||||||
if not self.productivity:
|
if not self.productivity:
|
||||||
return
|
# Proposal for Schema - If instance doesn't have any productivity, use the parent's productivity - if any.
|
||||||
|
if not self.settings["resource"].Nests:
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
parent_resource = self.settings["resource"].Nests[0].RelatingObject
|
||||||
|
self.productivity = ifcopenshell.util.element.get_psets(
|
||||||
|
parent_resource
|
||||||
|
).get("EPset_Productivity", None)
|
||||||
|
if not self.productivity:
|
||||||
|
return
|
||||||
|
|
||||||
unit_consumed = self.get_unit_consumed()
|
unit_consumed = self.get_unit_consumed()
|
||||||
self.unit_produced_name = self.productivity.get(
|
self.unit_produced_name = self.productivity.get(
|
||||||
"BaseQuantityProducedName", None
|
"BaseQuantityProducedName", None
|
||||||
|
|||||||
Reference in New Issue
Block a user