mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Fix issue #2740
This commit is contained in:
@@ -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"}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user