diff --git a/src/blenderbim/blenderbim/bim/module/pset/operator.py b/src/blenderbim/blenderbim/bim/module/pset/operator.py index 63caea9eff..ba2669a340 100644 --- a/src/blenderbim/blenderbim/bim/module/pset/operator.py +++ b/src/blenderbim/blenderbim/bim/module/pset/operator.py @@ -377,7 +377,7 @@ class CopyPropertyToSelection(bpy.types.Operator, Operator): class BIM_OT_add_property_to_edit(bpy.types.Operator): - bl_label = "Add new row" + bl_label = "Add Edit Rule" bl_idname = "bim.add_property_to_edit" bl_options = {"REGISTER", "UNDO"} option: bpy.props.StringProperty() diff --git a/src/blenderbim/blenderbim/bim/module/pset/ui.py b/src/blenderbim/blenderbim/bim/module/pset/ui.py index 0beb3882f3..a03b7e9f00 100644 --- a/src/blenderbim/blenderbim/bim/module/pset/ui.py +++ b/src/blenderbim/blenderbim/bim/module/pset/ui.py @@ -379,18 +379,19 @@ class BIM_PT_work_schedule_psets(Panel): class BIM_PT_bulk_property_editor(Panel): bl_label = "IFC Bulk Property Editor" - bl_space_type = 'PROPERTIES' - bl_region_type = 'WINDOW' + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" bl_context = "object" + bl_options = {"DEFAULT_CLOSED"} def draw(self, context): pass class BIM_PT_rename_parameters(Panel): - bl_label = "Rename all building elements" - bl_space_type = 'PROPERTIES' - bl_region_type = 'WINDOW' + bl_label = "Bulk Rename Properties" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" bl_context = "object" bl_parent_id = "BIM_PT_bulk_property_editor" bl_options = {"DEFAULT_CLOSED"} @@ -400,32 +401,31 @@ class BIM_PT_rename_parameters(Panel): layout = self.layout props = context.scene.RenameProperties - if props: - for index, prop in enumerate(props): - row = layout.row() - row.prop(prop, "pset_name", text="") - row.prop(prop, "existing_property_name", text="") - row.prop(prop, "new_property_name", text="") - op = row.operator("bim.remove_property_to_edit",icon="PANEL_CLOSE", text="") - op.index = index - op.option = "RenameProperties" - row = layout.row() - row.label() - op = row.operator("bim.add_property_to_edit", icon="ADD",text="") + op = row.operator("bim.add_property_to_edit", icon="ADD") op.option = "RenameProperties" if props: - row = layout.row() - clear = row.operator("bim.clear_list") + for index, prop in enumerate(props): + row = layout.row(align=True) + row.prop(prop, "pset_name", text="") + row.prop(prop, "existing_property_name", text="") + row.prop(prop, "new_property_name", text="") + op = row.operator("bim.remove_property_to_edit", icon="X", text="") + op.index = index + op.option = "RenameProperties" + + if props: + row = layout.row(align=True) + row.operator("bim.rename_parameters", icon="CHECKMARK") + clear = row.operator("bim.clear_list", icon="CANCEL", text="") clear.option = "RenameProperties" - row.operator("bim.rename_parameters") class BIM_PT_add_edit_custom_properties(Panel): - bl_label = "Add/Edit Custom Properties and Values (to selected objects)" - bl_space_type = 'PROPERTIES' - bl_region_type = 'WINDOW' + bl_label = "Bulk Add / Edit Custom Properties" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" bl_context = "object" bl_parent_id = "BIM_PT_bulk_property_editor" bl_options = {"DEFAULT_CLOSED"} @@ -435,33 +435,32 @@ class BIM_PT_add_edit_custom_properties(Panel): layout = self.layout props = context.scene.AddEditProperties + row = layout.row() + op = row.operator("bim.add_property_to_edit", icon="ADD") + op.option = "AddEditProperties" + if props: for index, prop in enumerate(props): - row = layout.row() + row = layout.row(align=True) row.prop(prop, "pset_name", text="") row.prop(prop, "property_name", text="") row.prop(prop, prop.get_value_name(), text="") row.prop(prop, "primary_measure_type", text="") - op = row.operator("bim.remove_property_to_edit",icon="PANEL_CLOSE", text="") + op = row.operator("bim.remove_property_to_edit", icon="X", text="") op.index = index op.option = "AddEditProperties" - row = layout.row() - row.label() - op = row.operator("bim.add_property_to_edit", icon="ADD",text="") - op.option = "AddEditProperties" - if props: - row = layout.row() - clear = row.operator("bim.clear_list") + row = layout.row(align=True) + op = row.operator("bim.add_edit_custom_property", icon="CHECKMARK", text="Apply Changes") + clear = row.operator("bim.clear_list", icon="CANCEL", text="") clear.option = "AddEditProperties" - op = row.operator("bim.add_edit_custom_property",icon="ADD", text="Apply Changes") class BIM_PT_delete_psets(Panel): - bl_label = "Bulk remove psets from selected objects" - bl_space_type = 'PROPERTIES' - bl_region_type = 'WINDOW' + bl_label = "Bulk Remove Psets" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" bl_context = "object" bl_parent_id = "BIM_PT_bulk_property_editor" bl_options = {"DEFAULT_CLOSED"} @@ -470,22 +469,21 @@ class BIM_PT_delete_psets(Panel): def draw(self, context): layout = self.layout props = context.scene.DeletePsets - + + row = layout.row() + op = row.operator("bim.add_property_to_edit", icon="ADD") + op.option = "DeletePsets" + if props: for index, prop in enumerate(props): - row = layout.row() - row.prop(prop, "pset_name", text="Pset") - op = row.operator("bim.remove_property_to_edit",icon="PANEL_CLOSE", text="") + row = layout.row(align=True) + row.prop(prop, "pset_name", text="") + op = row.operator("bim.remove_property_to_edit", icon="X", text="") op.index = index op.option = "DeletePsets" - row = layout.row(align=True) - row.label() - op = row.operator("bim.add_property_to_edit", icon="ADD",text="") - op.option = "DeletePsets" - if props: - row = layout.row() - clear = row.operator("bim.clear_list") + row = layout.row(align=True) + op = row.operator("bim.bulk_remove_psets", icon="CHECKMARK", text="Apply Changes") + clear = row.operator("bim.clear_list", icon="CANCEL", text="") clear.option = "DeletePsets" - op = row.operator("bim.bulk_remove_psets", text="Apply Changes") diff --git a/src/blenderbim/blenderbim/bim/module/search/prop.py b/src/blenderbim/blenderbim/bim/module/search/prop.py index ccd848d62d..cf97d4f01a 100644 --- a/src/blenderbim/blenderbim/bim/module/search/prop.py +++ b/src/blenderbim/blenderbim/bim/module/search/prop.py @@ -46,6 +46,7 @@ def update_is_class_selected(self, context): new = self.unselected_objects.add() new.obj = obj + def update_is_level_selected(self, context): if self.is_selected: for obj in self.unselected_objects: @@ -59,6 +60,7 @@ def update_is_level_selected(self, context): new = self.unselected_objects.add() new.obj = obj + class BIMFilterClasses(PropertyGroup): name: StringProperty(name="Name") is_selected: BoolProperty(name="Is Selected", default=True, update=update_is_class_selected) diff --git a/src/blenderbim/blenderbim/bim/module/structural/operator.py b/src/blenderbim/blenderbim/bim/module/structural/operator.py index ff7db4599a..f9ca9d17a8 100644 --- a/src/blenderbim/blenderbim/bim/module/structural/operator.py +++ b/src/blenderbim/blenderbim/bim/module/structural/operator.py @@ -320,9 +320,7 @@ class AssignStructuralAnalysisModel(bpy.types.Operator, Operator): def _execute(self, context): core.assign_structural_analysis_model( - tool.Ifc, tool.Structural, - product=self.product, - structural_analysis_model=self.structural_analysis_model + tool.Ifc, tool.Structural, product=self.product, structural_analysis_model=self.structural_analysis_model ) @@ -335,9 +333,7 @@ class UnassignStructuralAnalysisModel(bpy.types.Operator, Operator): def _execute(self, context): core.unassign_structural_analysis_model( - tool.Ifc, tool.Structural, - product=self.product, - structural_analysis_model=self.structural_analysis_model + tool.Ifc, tool.Structural, product=self.product, structural_analysis_model=self.structural_analysis_model ) diff --git a/src/blenderbim/blenderbim/bim/module/type/data.py b/src/blenderbim/blenderbim/bim/module/type/data.py index e553d59e4b..5921097e2a 100644 --- a/src/blenderbim/blenderbim/bim/module/type/data.py +++ b/src/blenderbim/blenderbim/bim/module/type/data.py @@ -36,11 +36,13 @@ class TypeData: # These two are loaded discretely because relating_types depends on relating_type_classes cls.data["relating_type_classes"] = cls.relating_type_classes() cls.data["relating_types"] = cls.relating_types() - cls.data.update({ - "is_product": cls.is_product(), - "total_instances": cls.total_instances(), - "type_name": cls.type_name(), - }) + cls.data.update( + { + "is_product": cls.is_product(), + "total_instances": cls.total_instances(), + "type_name": cls.type_name(), + } + ) @classmethod def relating_type_classes(cls):