mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Maintain active object throughout complex IFC operations for a better user experience
This commit is contained in:
@@ -232,6 +232,7 @@ class IfcStore:
|
||||
is_top_level_operator = not bool(IfcStore.current_transaction)
|
||||
|
||||
if is_top_level_operator:
|
||||
active_object = context.active_object
|
||||
IfcStore.begin_transaction(operator)
|
||||
IfcStore.get_file().begin_transaction()
|
||||
# This empty transaction ensures that each operator has at least one transaction
|
||||
@@ -247,6 +248,7 @@ class IfcStore:
|
||||
operator, rollback=lambda d: IfcStore.get_file().undo(), commit=lambda d: IfcStore.get_file().redo()
|
||||
)
|
||||
IfcStore.end_transaction(operator)
|
||||
context.view_layer.objects.active = active_object
|
||||
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user