From b44031aa891e2506cb88b505354cf0054c91a3aa Mon Sep 17 00:00:00 2001 From: Syres916 <46537884+Syres916@users.noreply.github.com> Date: Sat, 30 Nov 2024 15:41:55 +0000 Subject: [PATCH] Update SketchObject --- src/Mod/Sketcher/App/SketchObject.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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; } }