Draft: Fix clone of art object

This commit is contained in:
Stefan Tröger 2016-12-10 08:44:09 +01:00 committed by wmayer
parent 16787bf1a1
commit 9bb3193395
2 changed files with 8 additions and 1 deletions

View File

@ -2712,7 +2712,8 @@ def clone(obj,delta=None):
pass
return cl
else:
cl = FreeCAD.ActiveDocument.addObject("Part::AttachableObjectPython","Clone")
cl = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Clone")
cl.addExtension("Part::AttachExtensionPython", None)
cl.Label = prefix + obj[0].Label
_Clone(cl)
if gui:

View File

@ -132,6 +132,12 @@ class DraftTest(unittest.TestCase):
r2 = Draft.offset(r,FreeCAD.Vector(-1,-1,0),copy=True)
self.failUnless(r2,"Draft Offset failed")
def testCloneOfPart(self):
#test for a bug introduced by changes attachment code
box = FreeCAD.ActiveDocument.addObject("Part::Box", "Box")
clone = Draft.clone(box)
self.failUnless(clone.hasExtension("Part::AttachExtension"))
# modification tools
def tearDown(self):