mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +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"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
representation_id: bpy.props.IntProperty()
|
representation_id: bpy.props.IntProperty()
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
representation_id: int
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
|
start_time = time()
|
||||||
|
assert context.active_object
|
||||||
core.remove_representation(
|
core.remove_representation(
|
||||||
tool.Ifc,
|
tool.Ifc,
|
||||||
tool.Geometry,
|
tool.Geometry,
|
||||||
obj=context.active_object,
|
obj=context.active_object,
|
||||||
representation=tool.Ifc.get().by_id(self.representation_id),
|
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):
|
class PurgeUnusedRepresentations(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
|
|||||||
Reference in New Issue
Block a user