diff --git a/src/blenderbim/blenderbim/bim/__init__.py b/src/blenderbim/blenderbim/bim/__init__.py index 2f8586d9e4..41d8219434 100644 --- a/src/blenderbim/blenderbim/bim/__init__.py +++ b/src/blenderbim/blenderbim/bim/__init__.py @@ -145,6 +145,8 @@ classes = [ ui.BIM_PT_tab_services_object, # Structural analysis ui.BIM_PT_tab_structural, + # Construction scheduling + ui.BIM_PT_tab_4D5D, # Facility management ui.BIM_PT_tab_handover, ui.BIM_PT_tab_operations, diff --git a/src/blenderbim/blenderbim/bim/module/cost/ui.py b/src/blenderbim/blenderbim/bim/module/cost/ui.py index 351e9ae0e9..c083331c76 100644 --- a/src/blenderbim/blenderbim/bim/module/cost/ui.py +++ b/src/blenderbim/blenderbim/bim/module/cost/ui.py @@ -21,19 +21,21 @@ import blenderbim.bim.module.cost.prop as CostProp from bpy.types import Panel, UIList from blenderbim.bim.ifc import IfcStore from blenderbim.bim.module.cost.data import CostSchedulesData -import blenderbim.tool as tool class BIM_PT_cost_schedules(Panel): bl_label = "Cost Schedules" bl_idname = "BIM_PT_cost_schedules" + bl_options = {"DEFAULT_CLOSED"} bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "scene" + bl_parent_id = "BIM_PT_tab_4D5D" @classmethod def poll(cls, context): - return tool.Blender.is_tab(context, "SCHEDULING") and tool.Ifc.get() and tool.Ifc.get().schema != "IFC2X3" + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): if not CostSchedulesData.is_loaded: @@ -46,9 +48,8 @@ class BIM_PT_cost_schedules(Panel): row.label(text=f"{CostSchedulesData.data['total_cost_schedules']} Cost Schedules Found", icon="TEXT") row.operator("bim.export_cost_schedules", text="Export as spreadsheet", icon="EXPORT") else: - row.label(text="No Cost Schedules found.", icon="COMMUNITY") + row.label(text="No Cost Schedules Found found.", icon="COMMUNITY") row = self.layout.row() - row.alignment = "RIGHT" row.prop(self.props, "cost_schedule_predefined_types") row.operator("bim.add_cost_schedule", icon="ADD", text="Add") diff --git a/src/blenderbim/blenderbim/bim/module/resource/ui.py b/src/blenderbim/blenderbim/bim/module/resource/ui.py index 351bb5631c..4ce36e12bf 100644 --- a/src/blenderbim/blenderbim/bim/module/resource/ui.py +++ b/src/blenderbim/blenderbim/bim/module/resource/ui.py @@ -20,7 +20,6 @@ import blenderbim.bim.helper from bpy.types import Panel, UIList from blenderbim.bim.ifc import IfcStore from blenderbim.bim.module.resource.data import ResourceData -import blenderbim.tool as tool class BIM_PT_resources(Panel): @@ -30,10 +29,12 @@ class BIM_PT_resources(Panel): bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "scene" + bl_parent_id = "BIM_PT_tab_4D5D" @classmethod def poll(cls, context): - return tool.Blender.is_tab(context, "SCHEDULING") and tool.Ifc.get() and tool.Ifc.get().schema != "IFC2X3" + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): self.props = context.scene.BIMResourceProperties diff --git a/src/blenderbim/blenderbim/bim/module/sequence/ui.py b/src/blenderbim/blenderbim/bim/module/sequence/ui.py index 572977d379..eb0ccc477d 100644 --- a/src/blenderbim/blenderbim/bim/module/sequence/ui.py +++ b/src/blenderbim/blenderbim/bim/module/sequence/ui.py @@ -22,7 +22,6 @@ from bpy.types import Panel, UIList from blenderbim.bim.ifc import IfcStore from blenderbim.bim.helper import draw_attributes from blenderbim.bim.module.sequence.data import WorkPlansData, WorkScheduleData, SequenceData, TaskICOMData -import blenderbim.tool as tool class BIM_PT_work_plans(Panel): @@ -32,10 +31,12 @@ class BIM_PT_work_plans(Panel): bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "scene" + bl_parent_id = "BIM_PT_tab_4D5D" @classmethod def poll(cls, context): - return tool.Blender.is_tab(context, "SCHEDULING") and tool.Ifc.get() and tool.Ifc.get().schema != "IFC2X3" + file = IfcStore.get_file() + return file and file.schema != "IFC2X3" def draw(self, context): if not WorkPlansData.is_loaded: @@ -98,13 +99,16 @@ class BIM_PT_work_plans(Panel): class BIM_PT_work_schedules(Panel): bl_label = "Work Schedules" bl_idname = "BIM_PT_work_schedules" + bl_options = {"DEFAULT_CLOSED"} bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "scene" + bl_parent_id = "BIM_PT_tab_4D5D" @classmethod def poll(cls, context): - return tool.Blender.is_tab(context, "SCHEDULING") and tool.Ifc.get() and tool.Ifc.get().schema != "IFC2X3" + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): if not SequenceData.is_loaded: @@ -127,7 +131,7 @@ class BIM_PT_work_schedules(Panel): row = self.layout.row(align=True) row.alignment = "RIGHT" row.prop(self.props, "work_schedule_predefined_types") - row.operator("bim.add_work_schedule", text="Add", icon="ADD") + row.operator("bim.add_work_schedule", text="Add new", icon="ADD") for work_schedule_id, work_schedule in SequenceData.data["work_schedules"].items(): @@ -813,10 +817,12 @@ class BIM_PT_work_calendars(Panel): bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "scene" + bl_parent_id = "BIM_PT_tab_4D5D" @classmethod def poll(cls, context): - return tool.Blender.is_tab(context, "SCHEDULING") and tool.Ifc.get() and tool.Ifc.get().schema != "IFC2X3" + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): if not SequenceData.is_loaded: diff --git a/src/blenderbim/blenderbim/bim/ui.py b/src/blenderbim/blenderbim/bim/ui.py index 58958f4b20..81debd7574 100644 --- a/src/blenderbim/blenderbim/bim/ui.py +++ b/src/blenderbim/blenderbim/bim/ui.py @@ -404,6 +404,20 @@ class BIM_PT_geometry(Panel): pass +class BIM_PT_tab_4D5D(Panel): + bl_label = "Costing and Scheduling" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" + bl_context = "scene" + + @classmethod + def poll(cls, context): + return tool.Blender.is_tab(context, "SCHEDULING") and tool.Ifc.get() + + def draw(self, context): + pass + + class BIM_PT_tab_structural(Panel): bl_label = "Structural" bl_space_type = "PROPERTIES"