+//--------------------------------------------------------------------------------------
+SketchPtr copySketch(const std::shared_ptr<ModelAPI_Document> & thePart,
+ const SketchPtr & theSketch)
+{
+ FeaturePtr aCopyer = thePart->addFeature(SketchPlugin_SketchCopy::ID());
+ aCopyer->reference(SketchPlugin_SketchCopy::BASE_ID())->setValue(theSketch->feature());
+ aCopyer->execute();
+
+ FeaturePtr aNewSketch = thePart->nextFeature(aCopyer);
+
+ // perform removing the macro-feature
+ thePart->removeFeature(aCopyer);
+ apply();
+
+ return SketchPtr(new SketchAPI_Sketch(aNewSketch));
+}
+