From f5b6694c83c3519e37f5905f95997e384760feff Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 18 Oct 2017 21:17:15 +0200 Subject: [PATCH] fixes #0002434: merge sketches produces sketch on XY plane when original sketches were on XZ --- src/Mod/Sketcher/Gui/Command.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Mod/Sketcher/Gui/Command.cpp b/src/Mod/Sketcher/Gui/Command.cpp index 3ff7e5013f..241cb520ca 100644 --- a/src/Mod/Sketcher/Gui/Command.cpp +++ b/src/Mod/Sketcher/Gui/Command.cpp @@ -823,11 +823,17 @@ void CmdSketcherMergeSketches::activated(int iMsg) for (int i=0; i<=(addedConstraints-baseConstraints); i++){ Sketcher::Constraint * constraint= mergesketch->Constraints.getValues()[i+baseConstraints]; - if (constraint->First!=Sketcher::Constraint::GeoUndef || constraint->First==Sketcher::GeoEnum::HAxis || constraint->First==Sketcher::GeoEnum::VAxis) // not x, y axes or origin + if (constraint->First!=Sketcher::Constraint::GeoUndef || + constraint->First==Sketcher::GeoEnum::HAxis || + constraint->First==Sketcher::GeoEnum::VAxis) // not x, y axes or origin constraint->First+=baseGeometry; - if (constraint->Second!=Sketcher::Constraint::GeoUndef || constraint->Second==Sketcher::GeoEnum::HAxis || constraint->Second==Sketcher::GeoEnum::VAxis) // not x, y axes or origin + if (constraint->Second!=Sketcher::Constraint::GeoUndef || + constraint->Second==Sketcher::GeoEnum::HAxis || + constraint->Second==Sketcher::GeoEnum::VAxis) // not x, y axes or origin constraint->Second+=baseGeometry; - if (constraint->Third!=Sketcher::Constraint::GeoUndef || constraint->Third==Sketcher::GeoEnum::HAxis || constraint->Third==Sketcher::GeoEnum::VAxis) // not x, y axes or origin + if (constraint->Third!=Sketcher::Constraint::GeoUndef || + constraint->Third==Sketcher::GeoEnum::HAxis || + constraint->Third==Sketcher::GeoEnum::VAxis) // not x, y axes or origin constraint->Third+=baseGeometry; } @@ -835,7 +841,10 @@ void CmdSketcherMergeSketches::activated(int iMsg) baseConstraints=addedConstraints+1; } - doCommand(Gui,"App.activeDocument().recompute()"); + // apply the placement of the first sketch in the list (#0002434) + doCommand(Doc,"App.activeDocument().ActiveObject.Placement=App.activeDocument().%s.Placement" + ,selection.front().getFeatName()); + doCommand(Doc,"App.activeDocument().recompute()"); } bool CmdSketcherMergeSketches::isActive(void)