| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | import unittest |
| |
|
| | import FreeCAD |
| | import FreeCADGui |
| |
|
| | """ Test active object list """ |
| |
|
| |
|
| | class TestActiveObject(unittest.TestCase): |
| | def setUp(self): |
| | self.doc = FreeCAD.newDocument("PartDesignTestSketch") |
| | self.doc.UndoMode = True |
| |
|
| | def testPartBody(self): |
| | self.doc.openTransaction("Create part") |
| | part = self.doc.addObject("App::Part", "Part") |
| | FreeCADGui.activateView("Gui::View3DInventor", True) |
| | FreeCADGui.activeView().setActiveObject("part", part) |
| | self.doc.commitTransaction() |
| |
|
| | self.doc.openTransaction("Create body") |
| | body = self.doc.addObject("PartDesign::Body", "Body") |
| | part.addObject(body) |
| | FreeCADGui.activateView("Gui::View3DInventor", True) |
| | FreeCADGui.activeView().setActiveObject("pdbody", body) |
| | self.doc.commitTransaction() |
| |
|
| | self.doc.undo() |
| | self.doc.undo() |
| |
|
| | FreeCADGui.updateGui() |
| |
|
| | self.doc.openTransaction("Create body") |
| | body = self.doc.addObject("PartDesign::Body", "Body") |
| | FreeCADGui.activateView("Gui::View3DInventor", True) |
| | FreeCADGui.activeView().setActiveObject("pdbody", body) |
| | self.doc.commitTransaction() |
| |
|
| | FreeCADGui.updateGui() |
| |
|
| | def tearDown(self): |
| | FreeCAD.closeDocument("PartDesignTestSketch") |
| |
|