This commit is contained in:
Sigma Dimensions
2023-02-06 12:29:06 +01:00
parent 3a71b03a9a
commit 65990255e8
2 changed files with 6 additions and 5 deletions
@@ -251,10 +251,11 @@ class WorkPlansData:
@classmethod
def active_work_plan_schedules(cls):
if not self.props.active_work_plan_id:
results = []
if not bpy.context.scene.BIMWorkPlanProperties.active_work_plan_id:
return []
for rel in tool.Ifc.get().by_id(self.props.active_work_plan_id).IsDecomposedBy:
for related_object in rel.RelatedObjects:
for rel in tool.Ifc.get().by_id(bpy.context.scene.BIMWorkPlanProperties.active_work_plan_id).IsDecomposedBy:
for work_schedule in rel.RelatedObjects:
results.append({"id": work_schedule.id(), "name": work_schedule.Name or "Unnamed"})
return results
@@ -84,13 +84,13 @@ class DisableEditingWorkPlan(bpy.types.Operator, tool.Ifc.Operator):
core.disable_editing_work_plan(tool.Sequence)
class EnableEditingWorkPlanSchedules(bpy.types.Operator):
class EnableEditingWorkPlanSchedules(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.enable_editing_work_plan_schedules"
bl_label = "Enable Editing Work Plan Schedules"
bl_options = {"REGISTER", "UNDO"}
work_plan: bpy.props.IntProperty()
def execute(self, context):
def _execute(self, context):
core.enable_editing_work_plan_schedules(tool.Sequence, work_plan=tool.Ifc.get().by_id(self.work_plan))
return {"FINISHED"}