mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Update to ifcopenshell.util.date for handling of IfcDuration with python and import of Planned Durations from P6 .xml exports in blenderBIM
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import ifcopenshell.util.date
|
||||
from datetime import datetime
|
||||
from datetime import timedelta
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, **settings):
|
||||
|
||||
@@ -154,7 +154,8 @@ class Data:
|
||||
continue
|
||||
if "Start" in key or "Finish" in key or key == "StatusTime":
|
||||
data[key] = ifcopenshell.util.date.ifc2datetime(value)
|
||||
# TODO parse duration
|
||||
elif key == "ScheduleDuration":
|
||||
data[key] = ifcopenshell.util.date.ifc2datetime(value)
|
||||
cls.task_times[task_time.id()] = data
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -13,4 +13,7 @@ class Usecase:
|
||||
if "Start" in name or "Finish" in name or name == "StatusTime":
|
||||
if value:
|
||||
value = ifcopenshell.util.date.datetime2ifc(value, "IfcDateTime")
|
||||
if name == "ScheduleDuration":
|
||||
if value:
|
||||
value = ifcopenshell.util.date.datetime2ifc(value, "IfcDuration")
|
||||
setattr(self.settings["task_time"], name, value)
|
||||
|
||||
Reference in New Issue
Block a user