diff --git a/src/Mod/Assembly/CommandCreateJoint.py b/src/Mod/Assembly/CommandCreateJoint.py index 0bd7b142f6..410d8bb224 100644 --- a/src/Mod/Assembly/CommandCreateJoint.py +++ b/src/Mod/Assembly/CommandCreateJoint.py @@ -59,7 +59,10 @@ def activateJoint(index): JointObject.activeTask.reject() panel = TaskAssemblyCreateJoint(index) - Gui.Control.showDialog(panel) + dialog = Gui.Control.showDialog(panel) + if dialog is not None: + dialog.setAutoCloseOnTransactionChange(True) + dialog.setDocumentName(App.ActiveDocument.Name) class CommandCreateJointFixed: diff --git a/src/Mod/Assembly/JointObject.py b/src/Mod/Assembly/JointObject.py index 099bcad1d3..cf9033fbed 100644 --- a/src/Mod/Assembly/JointObject.py +++ b/src/Mod/Assembly/JointObject.py @@ -1383,6 +1383,9 @@ class TaskAssemblyCreateJoint(QtCore.QObject): self.joint.Visibility = self.visibilityBackup return True + def autoClosedOnTransactionChange(self): + self.reject() + def deactivate(self): global activeTask activeTask = None