From c23ebe2bbd3f19a8f17b908f8e5d746e24220824 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" <realthunder.dev@gmail.com> Date: Mon, 20 May 2019 08:30:05 +0800 Subject: [PATCH] assembly: minor change of error message --- assembly.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/assembly.py b/assembly.py index aac47f8..38c9f54 100644 --- a/assembly.py +++ b/assembly.py @@ -2349,11 +2349,12 @@ class AsmConstraint(AsmGroup): subs[-1] = '' subs[-2] = info.Part.Name subs[-3] = '2' + subs = '.'.join(subs) # remember last selection FreeCADGui.Selection.pushSelStack() FreeCADGui.Selection.clearSelection() - FreeCADGui.Selection.addSelection( - sel.Object,'.'.join(subs)) + FreeCADGui.Selection.addSelection(sel.Object,subs) + FreeCADGui.Selection.pushSelStack() FreeCADGui.runCommand('Std_LinkReplace') # restore the last selection @@ -2362,7 +2363,8 @@ class AsmConstraint(AsmGroup): info = elements[0].Proxy.getInfo(True) # make sure the replace command works if getLinkProperty(info.Part,'ElementCount') is None: - raise RuntimeError('Failed to replace part with a link') + raise RuntimeError('Failed to replace "{}" with a ' + 'link'.format(info.PartName)) # Let's first make an single element array without showing # its element object, which will make the linked object