mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
Fix issue #2740
This commit is contained in:
@@ -251,10 +251,11 @@ class WorkPlansData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def active_work_plan_schedules(cls):
|
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 []
|
return []
|
||||||
for rel in tool.Ifc.get().by_id(self.props.active_work_plan_id).IsDecomposedBy:
|
for rel in tool.Ifc.get().by_id(bpy.context.scene.BIMWorkPlanProperties.active_work_plan_id).IsDecomposedBy:
|
||||||
for related_object in rel.RelatedObjects:
|
for work_schedule in rel.RelatedObjects:
|
||||||
results.append({"id": work_schedule.id(), "name": work_schedule.Name or "Unnamed"})
|
results.append({"id": work_schedule.id(), "name": work_schedule.Name or "Unnamed"})
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|||||||
@@ -84,13 +84,13 @@ class DisableEditingWorkPlan(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
core.disable_editing_work_plan(tool.Sequence)
|
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_idname = "bim.enable_editing_work_plan_schedules"
|
||||||
bl_label = "Enable Editing Work Plan Schedules"
|
bl_label = "Enable Editing Work Plan Schedules"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
work_plan: bpy.props.IntProperty()
|
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))
|
core.enable_editing_work_plan_schedules(tool.Sequence, work_plan=tool.Ifc.get().by_id(self.work_plan))
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user