Update Brick References Panel

This commit is contained in:
rileywong311
2023-08-19 22:00:55 -07:00
committed by Riley Wong
parent 20d6eae50a
commit 991c42e816
2 changed files with 16 additions and 7 deletions
@@ -105,6 +105,7 @@ class ConvertBrickProject(bpy.types.Operator, Operator):
bl_idname = "bim.convert_brick_project" bl_idname = "bim.convert_brick_project"
bl_label = "Convert Brick Project" bl_label = "Convert Brick Project"
bl_options = {"REGISTER", "UNDO"} bl_options = {"REGISTER", "UNDO"}
bl_description = "Create an Ifc library for this Brick project"
def _execute(self, context): def _execute(self, context):
core.convert_brick_project(tool.Ifc, tool.Brick) core.convert_brick_project(tool.Ifc, tool.Brick)
@@ -114,6 +115,7 @@ class AssignBrickReference(bpy.types.Operator, Operator):
bl_idname = "bim.assign_brick_reference" bl_idname = "bim.assign_brick_reference"
bl_label = "Assign Brick Reference" bl_label = "Assign Brick Reference"
bl_options = {"REGISTER", "UNDO"} bl_options = {"REGISTER", "UNDO"}
bl_description = "Assign the selected Ifc entity to the selected Brick entity"
def _execute(self, context): def _execute(self, context):
props = context.scene.BIMBrickProperties props = context.scene.BIMBrickProperties
@@ -172,6 +174,7 @@ class ConvertIfcToBrick(bpy.types.Operator, Operator):
bl_idname = "bim.convert_ifc_to_brick" bl_idname = "bim.convert_ifc_to_brick"
bl_label = "Convert IFC To Brick" bl_label = "Convert IFC To Brick"
bl_options = {"REGISTER", "UNDO"} bl_options = {"REGISTER", "UNDO"}
bl_description = "Convert Ifc entities and relations to Brick entities and relations"
def _execute(self, context): def _execute(self, context):
props = context.scene.BIMBrickProperties props = context.scene.BIMBrickProperties
@@ -279,18 +279,24 @@ class BIM_PT_ifc_brickschema_references(Panel):
row.label(text="No Brickschema Project Loaded") row.label(text="No Brickschema Project Loaded")
return return
if not BrickschemaReferencesData.data["libraries"]: if not BrickschemaReferencesData.data["libraries"] and BrickStore.path:
row = self.layout.row(align=True) row = self.layout.row(align=True)
if BrickStore.path: row.label(text="No IFC Libraries")
row.label(text="No IFC Libraries") row.operator("bim.convert_brick_project", text="", icon="ADD")
row.operator("bim.convert_brick_project", text="", icon="ADD") return
else:
row.label(text="No IFC Libraries. Save the Brick project to create a new library.", icon="ERROR") if not BrickschemaReferencesData.data["libraries"] and not BrickStore.path:
row = self.layout.row(align=True)
row.label(text="No IFC Libraries: save the Brick project to create a new library", icon="ERROR")
row = self.layout.row(align=True)
row.label(text="Libraries must have location pointing to a \".ttl\" file", icon="INFO")
return return
row = self.layout.row(align=True) row = self.layout.row(align=True)
prop_with_search(row, self.props, "libraries") prop_with_search(row, self.props, "libraries")
row.operator("bim.convert_brick_project", text="", icon="ADD") if BrickStore.path:
row.operator("bim.convert_brick_project", text="", icon="ADD")
row = self.layout.row(align=True) row = self.layout.row(align=True)
row.operator("bim.assign_brick_reference", icon="ADD") row.operator("bim.assign_brick_reference", icon="ADD")