bim.remove_representation - show operator time if it took more than 10 sec #6784

This commit is contained in:
Andrej
2025-06-10 18:13:04 +05:00
parent b4bc7ec371
commit 2bb373c1b2
@@ -474,13 +474,21 @@ class RemoveRepresentation(bpy.types.Operator, tool.Ifc.Operator):
bl_options = {"REGISTER", "UNDO"}
representation_id: bpy.props.IntProperty()
if TYPE_CHECKING:
representation_id: int
def _execute(self, context):
start_time = time()
assert context.active_object
core.remove_representation(
tool.Ifc,
tool.Geometry,
obj=context.active_object,
representation=tool.Ifc.get().by_id(self.representation_id),
)
operator_time = time() - start_time
if operator_time > 10:
self.report({"INFO"}, f"{self.bl_label} was finished in {operator_time:.2f} seconds.")
class PurgeUnusedRepresentations(bpy.types.Operator, tool.Ifc.Operator):