From b79d23b3e27e35fb6ddd1eb2481a631c79df69b6 Mon Sep 17 00:00:00 2001 From: Gorgious56 Date: Fri, 30 Jul 2021 14:13:41 +0200 Subject: [PATCH] Hide panels with features unsupported in V2x3 (#1614) --- src/blenderbim/blenderbim/bim/module/cost/ui.py | 3 ++- src/blenderbim/blenderbim/bim/module/resource/ui.py | 3 ++- src/blenderbim/blenderbim/bim/module/sequence/ui.py | 9 ++++++--- .../blenderbim/bim/module/structural/ui.py | 12 ++++++++---- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/cost/ui.py b/src/blenderbim/blenderbim/bim/module/cost/ui.py index a2a0a0d3c8..8f47ecd85e 100644 --- a/src/blenderbim/blenderbim/bim/module/cost/ui.py +++ b/src/blenderbim/blenderbim/bim/module/cost/ui.py @@ -13,7 +13,8 @@ class BIM_PT_cost_schedules(Panel): @classmethod def poll(cls, context): - return IfcStore.get_file() + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): self.props = context.scene.BIMCostProperties diff --git a/src/blenderbim/blenderbim/bim/module/resource/ui.py b/src/blenderbim/blenderbim/bim/module/resource/ui.py index 1544d3fd39..f3619ed2de 100644 --- a/src/blenderbim/blenderbim/bim/module/resource/ui.py +++ b/src/blenderbim/blenderbim/bim/module/resource/ui.py @@ -13,7 +13,8 @@ class BIM_PT_resources(Panel): @classmethod def poll(cls, context): - return IfcStore.get_file() + 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 529d48bd9e..8a0c94da3f 100644 --- a/src/blenderbim/blenderbim/bim/module/sequence/ui.py +++ b/src/blenderbim/blenderbim/bim/module/sequence/ui.py @@ -17,7 +17,8 @@ class BIM_PT_work_plans(Panel): @classmethod def poll(cls, context): - return IfcStore.get_file() + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): if not Data.is_loaded: @@ -88,7 +89,8 @@ class BIM_PT_work_schedules(Panel): @classmethod def poll(cls, context): - return IfcStore.get_file() + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): self.props = context.scene.BIMWorkScheduleProperties @@ -429,7 +431,8 @@ class BIM_PT_work_calendars(Panel): @classmethod def poll(cls, context): - return IfcStore.get_file() + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): if not Data.is_loaded: diff --git a/src/blenderbim/blenderbim/bim/module/structural/ui.py b/src/blenderbim/blenderbim/bim/module/structural/ui.py index 295cd0f1c5..5ce31355b8 100644 --- a/src/blenderbim/blenderbim/bim/module/structural/ui.py +++ b/src/blenderbim/blenderbim/bim/module/structural/ui.py @@ -261,7 +261,8 @@ class BIM_PT_structural_analysis_models(Panel): @classmethod def poll(cls, context): - return IfcStore.get_file() + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): if not Data.is_loaded: @@ -345,7 +346,8 @@ class BIM_PT_structural_load_cases(Panel): @classmethod def poll(cls, context): - return IfcStore.get_file() + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): self.props = context.scene.BIMStructuralProperties @@ -449,7 +451,8 @@ class BIM_PT_structural_loads(Panel): @classmethod def poll(cls, context): - return IfcStore.get_file() + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): if not Data.is_loaded: @@ -516,7 +519,8 @@ class BIM_PT_boundary_conditions(Panel): @classmethod def poll(cls, context): - return IfcStore.get_file() + file = IfcStore.get_file() + return file and hasattr(file, "schema") and file.schema != "IFC2X3" def draw(self, context): if not Data.is_loaded: