Optimise create owner history to not rely on a person and organisation lookup, speeding up long procedures

This commit is contained in:
Dion Moult
2021-10-01 11:05:35 +10:00
parent 8bcec29429
commit 0a27308532
11 changed files with 92 additions and 107 deletions
@@ -24,9 +24,9 @@ class Usecase:
name=self.settings["name"],
)
work_schedule.CreationDate = ifcopenshell.util.date.datetime2ifc(datetime.now(), "IfcDateTime")
person = ifcopenshell.api.owner.settings.get_person(self.file)
if person:
work_schedule.Creators = [person]
user = ifcopenshell.api.owner.settings.get_user(self.file)
if user:
work_schedule.Creators = [user.ThePerson]
work_schedule.StartTime = ifcopenshell.util.date.datetime2ifc(self.settings["start_time"], "IfcDateTime")
if self.settings["work_plan"]: