Draft can now copy sketches

This commit is contained in:
Yorik van Havre 2012-04-12 16:10:45 -03:00
parent cd2adf6a28
commit eeb4e60162

View File

@ -666,6 +666,12 @@ def makeCopy(obj,force=None,reparent=False):
ArchCell._Cell(newobj)
if gui:
ArchCell._ViewProviderCell(newobj.ViewObject)
elif (getType(obj) == "Sketch") or (force == "Sketch"):
newobj = FreeCAD.ActiveDocument.addObject("Sketcher::SketchObject",getRealName(obj.Name))
for geo in obj.Geometries:
newobj.addGeometry(geo)
for con in obj.constraints:
newobj.addConstraint(con)
elif obj.isDerivedFrom("Part::Feature"):
newobj = FreeCAD.ActiveDocument.addObject("Part::Feature",getRealName(obj.Name))
newobj.Shape = obj.Shape