mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
bim.remove_representation - show operator time if it took more than 10 sec #6784
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user