Modifications to scheduled dates can now cascade through the task tree

This commit is contained in:
Dion Moult
2021-06-17 13:23:09 +10:00
parent 97d0286b57
commit 50608d9459
5 changed files with 192 additions and 17 deletions
@@ -565,12 +565,15 @@ class AssignPredecessor(bpy.types.Operator):
def execute(self, context):
props = context.scene.BIMWorkScheduleProperties
self.file = IfcStore.get_file()
ifcopenshell.api.run(
rel = ifcopenshell.api.run(
"sequence.assign_sequence",
self.file,
relating_process=IfcStore.get_file().by_id(self.task),
related_process=IfcStore.get_file().by_id(props.active_task_id),
)
ifcopenshell.api.run(
"sequence.edit_sequence", self.file, rel_sequence=rel, attributes={"SequenceType": "FINISH_START"}
)
Data.load(self.file)
bpy.ops.bim.load_task_properties(task=self.task)
return {"FINISHED"}
@@ -584,12 +587,15 @@ class AssignSuccessor(bpy.types.Operator):
def execute(self, context):
props = context.scene.BIMWorkScheduleProperties
self.file = IfcStore.get_file()
ifcopenshell.api.run(
rel = ifcopenshell.api.run(
"sequence.assign_sequence",
self.file,
relating_process=IfcStore.get_file().by_id(props.active_task_id),
related_process=IfcStore.get_file().by_id(self.task),
)
ifcopenshell.api.run(
"sequence.edit_sequence", self.file, rel_sequence=rel, attributes={"SequenceType": "FINISH_START"}
)
Data.load(self.file)
bpy.ops.bim.load_task_properties(task=self.task)
return {"FINISHED"}