mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 09:32:37 +00:00
simplify updateTaskDuration
This commit is contained in:
@@ -209,17 +209,12 @@ def updateTaskDuration(self, context):
|
|||||||
self.duration = "-"
|
self.duration = "-"
|
||||||
return
|
return
|
||||||
|
|
||||||
self.file = tool.Ifc.get()
|
task = tool.Ifc.get().by_id(self.ifc_definition_id)
|
||||||
task = self.file.by_id(self.ifc_definition_id)
|
|
||||||
if task.TaskTime:
|
if task.TaskTime:
|
||||||
task_time = task.TaskTime
|
task_time = task.TaskTime
|
||||||
else:
|
else:
|
||||||
task_time = ifcopenshell.api.run("sequence.add_task_time", self.file, task=task)
|
task_time = tool.Ifc.run("sequence.add_task_time", task=task)
|
||||||
ifcopenshell.api.run(
|
tool.Ifc.run("sequence.edit_task_time", task_time=task_time, attributes={"ScheduleDuration": duration})
|
||||||
"sequence.edit_task_time",
|
|
||||||
self.file,
|
|
||||||
**{"task_time": task_time, "attributes": {"ScheduleDuration": duration}},
|
|
||||||
)
|
|
||||||
SequenceData.load()
|
SequenceData.load()
|
||||||
bpy.ops.bim.load_task_properties()
|
bpy.ops.bim.load_task_properties()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user