fixes #0002434: merge sketches produces sketch on XY plane when original sketches were on XZ

This commit is contained in:
wmayer
2017-10-18 21:17:15 +02:00
parent dcaf263e4c
commit f5b6694c83

View File

@@ -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)