From 96fcedbd301651c64fb37dc1d7436ae01cefaf53 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Mon, 10 Apr 2017 17:07:50 +0200 Subject: [PATCH] Sketcher: Carbon Copy - Allow cross-body sketcher links ======================================================= The instructions are shown on the status bar. press CTRL to allow cross-body link press ALT to by-pass directional requirements press CTRL+ALT to allow a cross-body link and by-pass directional requirements --- src/Mod/Sketcher/App/SketchObject.cpp | 2 +- src/Mod/Sketcher/Gui/CommandCreateGeo.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 4feaca8b68..f166d8b734 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -2047,7 +2047,7 @@ bool SketchObject::isCarbonCopyAllowed(App::Document *pDoc, App::DocumentObject App::Part* part_obj = App::Part::getPartOfObject(pObj, true); if (part_this == part_obj){ //either in the same part, or in the root of document if (body_this != NULL) { - if (body_this != body_obj) { + if ((body_this != body_obj) && !this->allowOtherBody) { if (rsn) *rsn = rlOtherBody; return false; diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index e967b7ce48..5aaa2bd2fc 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -6198,8 +6198,8 @@ namespace SketcherGui { Q_UNUSED(sSubName); Sketcher::SketchObject *sketch = static_cast(object); - sketch->allowOtherBody = false; - sketch->allowUnaligned = (QApplication::keyboardModifiers() == Qt::ControlModifier); + sketch->allowOtherBody = (QApplication::keyboardModifiers() == Qt::ControlModifier || QApplication::keyboardModifiers() == (Qt::ControlModifier | Qt::AltModifier)); + sketch->allowUnaligned = (QApplication::keyboardModifiers() == Qt::AltModifier || QApplication::keyboardModifiers() == (Qt::ControlModifier | Qt::AltModifier)); this->notAllowedReason = ""; Sketcher::SketchObject::eReasonList msg; @@ -6214,19 +6214,19 @@ namespace SketcherGui { this->notAllowedReason = QT_TR_NOOP("This object is in another document."); break; case Sketcher::SketchObject::rlOtherBody: - this->notAllowedReason = QT_TR_NOOP("This object belongs to another body."); + this->notAllowedReason = QT_TR_NOOP("This object belongs to another body. Hold Ctrl to allow crossreferences."); break; case Sketcher::SketchObject::rlOtherPart: this->notAllowedReason = QT_TR_NOOP("This object belongs to another part."); break; case Sketcher::SketchObject::rlNonParallel: - this->notAllowedReason = QT_TR_NOOP("The selected sketch is not parallel to this sketch. Hold Ctrl to allow non-parallel sketchs."); + this->notAllowedReason = QT_TR_NOOP("The selected sketch is not parallel to this sketch. Hold Alt to allow non-parallel sketchs."); break; case Sketcher::SketchObject::rlAxesMisaligned: - this->notAllowedReason = QT_TR_NOOP("The XY axes of the selected sketch do not have the same direction as this sketch. Hold Ctrl to disregard it."); + this->notAllowedReason = QT_TR_NOOP("The XY axes of the selected sketch do not have the same direction as this sketch. Hold Alt to disregard it."); break; case Sketcher::SketchObject::rlOriginsMisaligned: - this->notAllowedReason = QT_TR_NOOP("The origin of the selected sketch is not aligned with the origin of this sketch. Hold Ctrl to disregard it."); + this->notAllowedReason = QT_TR_NOOP("The origin of the selected sketch is not aligned with the origin of this sketch. Hold Alt to disregard it."); break; default: break;