diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 67b1682ec8ae..696791000605 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -4668,30 +4668,38 @@ bool SketchObject::isExternalAllowed(App::Document* pDoc, App::DocumentObject* p bool SketchObject::isCarbonCopyAllowed(App::Document* pDoc, App::DocumentObject* pObj, bool& xinv, bool& yinv, eReasonList* rsn) const { - if (rsn) + if (rsn) { *rsn = rlAllowed; + } + + std::string sketchArchType ("Sketcher::SketchObjectPython"); // Only applicable to sketches - if (pObj->getTypeId() != Sketcher::SketchObject::getClassTypeId()) { - if (rsn) + if (pObj->getTypeId() != Sketcher::SketchObject::getClassTypeId() + && sketchArchType != pObj->getTypeId().getName()) { + if (rsn) { *rsn = rlNotASketch; + } return false; } + SketchObject* psObj = static_cast(pObj); // Sketches outside of the Document are NOT allowed if (this->getDocument() != pDoc) { - if (rsn) + if (rsn) { *rsn = rlOtherDoc; + } return false; } // circular reference prevention try { if (!(this->testIfLinkDAGCompatible(pObj))) { - if (rsn) + if (rsn) { *rsn = rlCircularReference; + } return false; } }