From b3b5ffbf5530ed21b351aaf2ea0e70234d0c0148 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Wed, 30 Aug 2023 12:45:34 +0200 Subject: [PATCH] Put try catch around actual arranging `arrange` is the function that _could_ fail CURA-7951 --- cura/Arranging/ArrangeObjectsJob.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cura/Arranging/ArrangeObjectsJob.py b/cura/Arranging/ArrangeObjectsJob.py index b1e0432786..48d2436482 100644 --- a/cura/Arranging/ArrangeObjectsJob.py +++ b/cura/Arranging/ArrangeObjectsJob.py @@ -32,17 +32,18 @@ class ArrangeObjectsJob(Job): title = i18n_catalog.i18nc("@info:title", "Finding Location")) status_message.show() + if self._grid_arrange: + arranger = GridArrange(self._nodes, Application.getInstance().getBuildVolume(), self._fixed_nodes) + else: + arranger = Nest2DArrange(self._nodes, Application.getInstance().getBuildVolume(), self._fixed_nodes, + factor=1000) + + found_solution_for_all = False try: - if self._grid_arrange: - arranger = GridArrange(self._nodes, Application.getInstance().getBuildVolume(), self._fixed_nodes) - else: - arranger = Nest2DArrange(self._nodes, Application.getInstance().getBuildVolume(), self._fixed_nodes, - factor=1000) - found_solution_for_all = arranger.arrange() - except: # If the thread crashes, the message should still close - Logger.logException("e", "Unable to arrange the objects on the buildplate. The arrange algorithm has crashed.") + Logger.logException("e", + "Unable to arrange the objects on the buildplate. The arrange algorithm has crashed.") status_message.hide()