mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 22:12:32 +00:00
Add messages for operations with locked elements
Otherwise they just silently failing leaving user confused
This commit is contained in:
@@ -644,6 +644,7 @@ class OverrideDelete(bpy.types.Operator):
|
|||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
if element:
|
if element:
|
||||||
if tool.Geometry.is_locked(element):
|
if tool.Geometry.is_locked(element):
|
||||||
|
self.report({"ERROR"}, f"Element '{obj.name}' is locked and cannot be deleted.")
|
||||||
continue
|
continue
|
||||||
if ifcopenshell.util.element.get_pset(element, "BBIM_Array"):
|
if ifcopenshell.util.element.get_pset(element, "BBIM_Array"):
|
||||||
self.report({"INFO"}, "Elements that are part of an array cannot be deleted.")
|
self.report({"INFO"}, "Elements that are part of an array cannot be deleted.")
|
||||||
@@ -775,6 +776,7 @@ class OverrideOutlinerDelete(bpy.types.Operator):
|
|||||||
for obj in objects_to_delete:
|
for obj in objects_to_delete:
|
||||||
if element := tool.Ifc.get_entity(obj):
|
if element := tool.Ifc.get_entity(obj):
|
||||||
if tool.Geometry.is_locked(element):
|
if tool.Geometry.is_locked(element):
|
||||||
|
self.report({"ERROR"}, f"Element '{obj.name}' is locked and cannot be deleted.")
|
||||||
if collection := obj.BIMObjectProperties.collection:
|
if collection := obj.BIMObjectProperties.collection:
|
||||||
collections_to_delete.discard(collection)
|
collections_to_delete.discard(collection)
|
||||||
continue
|
continue
|
||||||
@@ -891,6 +893,7 @@ class OverrideDuplicateMove(bpy.types.Operator):
|
|||||||
continue # For now, don't copy drawings until we stabilise a bit more. It's tricky.
|
continue # For now, don't copy drawings until we stabilise a bit more. It's tricky.
|
||||||
elif tool.Geometry.is_locked(element):
|
elif tool.Geometry.is_locked(element):
|
||||||
obj.select_set(False)
|
obj.select_set(False)
|
||||||
|
self.report({"ERROR"}, f"Element '{obj.name}' is locked and cannot be duplicated.")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
linked_non_ifc_object = linked and not element
|
linked_non_ifc_object = linked and not element
|
||||||
@@ -1609,6 +1612,7 @@ class OverrideModeSetEdit(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
if not element:
|
if not element:
|
||||||
continue
|
continue
|
||||||
if tool.Geometry.is_locked(element):
|
if tool.Geometry.is_locked(element):
|
||||||
|
self.report({"ERROR"}, f"Element '{obj.name}' is locked and cannot be edited.")
|
||||||
obj.select_set(False)
|
obj.select_set(False)
|
||||||
continue
|
continue
|
||||||
representation = tool.Geometry.get_active_representation(obj)
|
representation = tool.Geometry.get_active_representation(obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user