Cancelling the just created surface deletes it

Now if the user creates a surface, the cancel in the widget deletes it.
If an already existing one is opened for editing, cancel rejects the
user change in fill type, but the surface remains.
This commit is contained in:
balazs-bamer
2015-01-29 09:59:00 +01:00
committed by wmayer
parent 29eed4a3f6
commit 76c357ad70
7 changed files with 34 additions and 13 deletions

View File

@@ -253,7 +253,8 @@ void CmdSurfaceBSurf::createBezier()
openCommand("Create Bezier surface");
doCommand(Doc,"FreeCAD.ActiveDocument.addObject(\"Surface::BezSurf\",\"%s\")", FeatName.c_str());
doCommand(Doc, "FreeCAD.ActiveDocument.ActiveObject.filltype=1"); // TODO ask filltype from user and check it
// invalid fill type meaning the surface is just created and cancel should delete it
doCommand(Doc, "FreeCAD.ActiveDocument.ActiveObject.filltype=0");
doCommand(Doc, "Gui.ActiveDocument.setEdit('%s',0)", FeatName.c_str());
doCommand(Doc, bezListCmd.str().c_str());
updateActive();
@@ -273,7 +274,8 @@ void CmdSurfaceBSurf::createBSpline()
openCommand("Create BSpline surface");
doCommand(Doc,"FreeCAD.ActiveDocument.addObject(\"Surface::BSplineSurf\",\"%s\")", FeatName.c_str());
doCommand(Doc, "FreeCAD.ActiveDocument.ActiveObject.filltype=1");
// invalid fill type meaning the surface is just created and cancel should delete it
doCommand(Doc, "FreeCAD.ActiveDocument.ActiveObject.filltype=0");
doCommand(Doc, bspListCmd.str().c_str());
doCommand(Doc, "Gui.ActiveDocument.setEdit('%s',0)", FeatName.c_str());
updateActive();