Ensure Correct Scale in DrawViewSection

- when the Source View for a Section is a Projection
  Group item, need to use the Scale property from the
  parent Projection Group.
This commit is contained in:
wandererfan
2018-06-05 12:31:58 -04:00
committed by wmayer
parent a8daaf4a45
commit 6c4e4b35af

View File

@@ -334,6 +334,7 @@ void CmdTechDrawNewViewSection::activated(int iMsg)
TechDraw::DrawViewPart* dvp = static_cast<TechDraw::DrawViewPart*>(*baseObj.begin());
std::string BaseName = dvp->getNameInDocument();
std::string PageName = page->getNameInDocument();
double baseScale = dvp->getScale();
Gui::WaitCursor wc;
openCommand("Create view");
@@ -344,13 +345,13 @@ void CmdTechDrawNewViewSection::activated(int iMsg)
App::DocumentObject *docObj = getDocument()->getObject(FeatName.c_str());
TechDraw::DrawViewSection* dsv = dynamic_cast<TechDraw::DrawViewSection *>(docObj);
if (!dsv) {
throw Base::Exception("CmdTechDrawNewViewSection DSV not found\n");
throw Base::Exception("CmdTechDrawNewViewSection DVS not found\n");
}
dsv->Source.setValues(dvp->Source.getValues());
doCommand(Doc,"App.activeDocument().%s.BaseView = App.activeDocument().%s",FeatName.c_str(),BaseName.c_str());
doCommand(Doc,"App.activeDocument().%s.Scale = App.activeDocument().%s.Scale",FeatName.c_str(),BaseName.c_str());
doCommand(Doc,"App.activeDocument().%s.ScaleType = App.activeDocument().%s.ScaleType",FeatName.c_str(),BaseName.c_str());
doCommand(Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",PageName.c_str(),FeatName.c_str());
doCommand(Doc,"App.activeDocument().%s.Scale = %0.6f",FeatName.c_str(),baseScale);
Gui::Control().showDialog(new TaskDlgSectionView(dvp,dsv));
updateActive();