Skip to content

Commit

Permalink
Update SketchObject.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Syres916 authored Nov 30, 2024
1 parent 9f0e9a2 commit 2323afb
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/Mod/Sketcher/App/SketchObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<SketchObject*>(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;
}
}
Expand Down

0 comments on commit 2323afb

Please sign in to comment.