mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-16 10:34:31 +00:00
Fix bug where removing mapped representations leaving you with nothing was a poor user experience
This commit is contained in:
@@ -20,7 +20,6 @@ class Usecase:
|
||||
for item in self.settings["representation"].Items:
|
||||
item.MappingSource = dummy_representation_map
|
||||
ifcopenshell.util.element.remove_deep(self.file, self.settings["representation"])
|
||||
self.file.remove(self.settings["representation"])
|
||||
|
||||
def remove_entire_representation_tree(self):
|
||||
dummy_context = self.file.create_entity("IfcRepresentationContext")
|
||||
|
||||
@@ -181,13 +181,11 @@ class UnassignClass(bpy.types.Operator):
|
||||
product = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
||||
self.remove_representations(obj, product)
|
||||
IfcStore.unlink_element(product, obj)
|
||||
usecase = remove_product.Usecase(
|
||||
self.file,
|
||||
{"product": product},
|
||||
)
|
||||
usecase.execute()
|
||||
remove_product.Usecase(self.file, {"product": product}).execute()
|
||||
if "/" in obj.name and obj.name[0:3] == "Ifc":
|
||||
obj.name = "/".join(obj.name.split("/")[1:])
|
||||
if obj.data and obj.data.name == "Void":
|
||||
bpy.data.objects.remove(obj)
|
||||
return {"FINISHED"}
|
||||
|
||||
def remove_representations(self, obj, product):
|
||||
|
||||
Reference in New Issue
Block a user