diff --git a/src/blenderbim/blenderbim/bim/module/classification/data.py b/src/blenderbim/blenderbim/bim/module/classification/data.py index 5e04e3bf7c..1032e2b802 100644 --- a/src/blenderbim/blenderbim/bim/module/classification/data.py +++ b/src/blenderbim/blenderbim/bim/module/classification/data.py @@ -65,12 +65,13 @@ class ClassificationsData: class ReferencesData: @classmethod - def is_available_classification_added(cls): + def active_classification_library(cls): if not IfcStore.classification_file or not IfcStore.classification_file.by_type("IfcClassification"): return False props = bpy.context.scene.BIMClassificationProperties name = IfcStore.classification_file.by_id(int(props.available_classifications)).Name - return name in [e.Name for e in tool.Ifc.get().by_type("IfcClassification")] + if name in [e.Name for e in tool.Ifc.get().by_type("IfcClassification")]: + return name class ClassificationReferencesData(ReferencesData): @@ -81,7 +82,7 @@ class ClassificationReferencesData(ReferencesData): def load(cls): cls.is_loaded = True cls.data["references"] = cls.references() - cls.data["is_available_classification_added"] = cls.is_available_classification_added() + cls.data["active_classification_library"] = cls.active_classification_library() @classmethod def references(cls): @@ -103,7 +104,7 @@ class MaterialClassificationsData(ReferencesData): def load(cls): cls.is_loaded = True cls.data["references"] = cls.references() - cls.data["is_available_classification_added"] = cls.is_available_classification_added() + cls.data["active_classification_library"] = cls.active_classification_library() @classmethod def references(cls): @@ -125,7 +126,7 @@ class CostClassificationsData(ReferencesData): def load(cls): cls.is_loaded = True cls.data["references"] = cls.references() - cls.data["is_available_classification_added"] = cls.is_available_classification_added() + cls.data["active_classification_library"] = cls.active_classification_library() @classmethod def references(cls): diff --git a/src/blenderbim/blenderbim/bim/module/classification/ui.py b/src/blenderbim/blenderbim/bim/module/classification/ui.py index b0c3cf5d18..8bf5f660c7 100644 --- a/src/blenderbim/blenderbim/bim/module/classification/ui.py +++ b/src/blenderbim/blenderbim/bim/module/classification/ui.py @@ -100,12 +100,16 @@ class ReferenceUI: self.draw_reference_ui(reference) def draw_add_ui(self, context): - if not self.data.data["is_available_classification_added"]: + if not self.data.data["active_classification_library"]: + row = self.layout.row(align=True) + row.label(text="No Active Classification Library") + row.operator("bim.load_classification_library", text="", icon="IMPORT") return row = self.layout.row(align=True) - row.prop(self.sprops, "available_classifications", text="") + row.label(text=f"Active Classification Library: {self.data.data['active_classification_library']}") + #row.prop(self.sprops, "available_classifications", text="") if not self.sprops.available_library_references: - op = row.operator("bim.change_classification_level", text="", icon="IMPORT") + op = row.operator("bim.change_classification_level", text="", icon="GREASEPENCIL") op.parent_id = int(self.sprops.available_classifications) return if self.sprops.active_library_referenced_source: