diff --git a/src/ifcblenderexport/blenderbim/bim/__init__.py b/src/ifcblenderexport/blenderbim/bim/__init__.py index 1e710faf92..d06f30ca42 100644 --- a/src/ifcblenderexport/blenderbim/bim/__init__.py +++ b/src/ifcblenderexport/blenderbim/bim/__init__.py @@ -90,10 +90,6 @@ if bpy is not None: operator.SelectGlobalId, operator.SelectAttribute, operator.SelectPset, - operator.CreateAggregate, - operator.EditAggregate, - operator.SaveAggregate, - operator.ExplodeAggregate, operator.LoadClassification, operator.AddClassification, operator.RemoveClassification, diff --git a/src/ifcblenderexport/blenderbim/bim/operator.py b/src/ifcblenderexport/blenderbim/bim/operator.py index 7b8c2777a2..22a4e0e0bb 100644 --- a/src/ifcblenderexport/blenderbim/bim/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/operator.py @@ -1261,106 +1261,6 @@ class SelectSchemaDir(bpy.types.Operator): return {"RUNNING_MODAL"} -class CreateAggregate(bpy.types.Operator): - bl_idname = "bim.create_aggregate" - bl_label = "Create Aggregate" - - def execute(self, context): - spatial_container = None - for obj in bpy.context.selected_objects: - if obj.instance_collection: - return {"FINISHED"} - for collection in obj.users_collection: - if "IfcRelAggregates" in collection.name: - return {"FINISHED"} - elif collection.name[0:3] == "Ifc": - spatial_container = collection - if not spatial_container: - return {"FINISHED"} - - aggregate = bpy.data.collections.new( - "IfcRelAggregates/{}".format(bpy.context.scene.BIMProperties.aggregate_class) - ) - for project in [c for c in bpy.context.view_layer.layer_collection.children if "IfcProject" in c.name]: - if not [c for c in project.children if "Aggregates" in c.name]: - aggregates = bpy.data.collections.new("Aggregates") - project.collection.children.link(aggregates) - for aggregate_collection in [c for c in project.children if "Aggregates" in c.name]: - aggregate_collection.collection.children.link(aggregate) - break - break - for obj in bpy.context.selected_objects: - for collection in obj.users_collection: - collection.objects.unlink(obj) - aggregate.objects.link(obj) - - instance = bpy.data.objects.new( - "{}/{}".format( - bpy.context.scene.BIMProperties.aggregate_class, bpy.context.scene.BIMProperties.aggregate_name - ), - None, - ) - instance.instance_type = "COLLECTION" - instance.instance_collection = aggregate - spatial_container.objects.link(instance) - return {"FINISHED"} - - -class EditAggregate(bpy.types.Operator): - bl_idname = "bim.edit_aggregate" - bl_label = "Edit Aggregate" - - def execute(self, context): - obj = bpy.context.active_object - if obj.instance_type != "COLLECTION" or "IfcRelAggregates" not in obj.instance_collection.name: - return {"FINISHED"} - bpy.context.view_layer.objects[obj.name].hide_viewport = True - for project in [c for c in bpy.context.view_layer.layer_collection.children if "IfcProject" in c.name]: - for aggregate_collection in [c for c in project.children if "Aggregates" in c.name]: - aggregate_collection.hide_viewport = False - return {"FINISHED"} - - -class SaveAggregate(bpy.types.Operator): - bl_idname = "bim.save_aggregate" - bl_label = "Save Aggregate" - - def execute(self, context): - obj = bpy.context.active_object - aggregate = None - names = [c.name for c in obj.users_collection] - for project in [c for c in bpy.context.view_layer.layer_collection.children if "IfcProject" in c.name]: - for aggregate_collection in [c for c in project.children if "Aggregates" in c.name]: - aggregate_collection.hide_viewport = True - for collection in [c for c in aggregate_collection.children if c.name in names]: - aggregate = collection.collection - break - if not aggregate: - return {"FINISHED"} - for obj in bpy.context.view_layer.objects: - if obj.instance_collection == aggregate: - obj.hide_viewport = False - return {"FINISHED"} - - -class ExplodeAggregate(bpy.types.Operator): - bl_idname = "bim.explode_aggregate" - bl_label = "Explode Aggregate" - - def execute(self, context): - obj = bpy.context.active_object - if obj.instance_type != "COLLECTION" or "IfcRelAggregates" not in obj.instance_collection.name: - return {"FINISHED"} - aggregate_collection = bpy.data.collections.get(obj.instance_collection.name) - spatial_collection = obj.users_collection[0] - for part in aggregate_collection.objects: - spatial_collection.objects.link(part) - aggregate_collection.objects.unlink(part) - bpy.data.objects.remove(obj, do_unlink=True) - bpy.data.collections.remove(aggregate_collection, do_unlink=True) - return {"FINISHED"} - - class LoadClassification(bpy.types.Operator): bl_idname = "bim.load_classification" bl_label = "Load Classification" diff --git a/src/ifcblenderexport/blenderbim/bim/prop.py b/src/ifcblenderexport/blenderbim/bim/prop.py index 6750448819..2d1862b0b2 100644 --- a/src/ifcblenderexport/blenderbim/bim/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/prop.py @@ -1075,8 +1075,6 @@ class BIMProperties(PropertyGroup): diff_old_file: StringProperty(default="", name="Diff Old IFC File") diff_new_file: StringProperty(default="", name="Diff New IFC File") diff_relationships: StringProperty(default="", name="Diff Relationships") - aggregate_class: EnumProperty(items=getIfcClasses, name="Aggregate Class") - aggregate_name: StringProperty(name="Aggregate Name") classification: EnumProperty(items=getClassifications, name="Classification", update=refreshReferences) active_classification_name: StringProperty(name="Active Classification Name") classifications: CollectionProperty(name="Classifications", type=Classification) diff --git a/src/ifcblenderexport/blenderbim/bim/ui.py b/src/ifcblenderexport/blenderbim/bim/ui.py index 97d96bb103..a0a698b400 100644 --- a/src/ifcblenderexport/blenderbim/bim/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/ui.py @@ -771,20 +771,6 @@ class BIM_PT_bim(Panel): row.operator("bim.select_class") row.operator("bim.select_type") - layout.label(text="Aggregates:") - row = layout.row() - row.prop(bim_properties, "aggregate_class") - row = layout.row() - row.prop(bim_properties, "aggregate_name") - - row = layout.row(align=True) - row.operator("bim.create_aggregate") - row.operator("bim.explode_aggregate") - - row = layout.row(align=True) - row.operator("bim.edit_aggregate") - row.operator("bim.save_aggregate") - class BIM_PT_search(Panel): bl_label = "IFC Search"