Switched TemplatePyMod scripts to PySide

This commit is contained in:
Yorik van Havre
2014-01-09 18:46:16 -02:00
parent f73a3d6b8a
commit d00327640a
4 changed files with 58 additions and 58 deletions
+27 -27
View File
@@ -10,35 +10,35 @@ FreeCADCmd -P <path_to_file> Automation.py
import FreeCAD, Part
def makeSnapshotWithGui():
from PyQt4 import QtGui
import FreeCADGui
def getMainWindow():
toplevel = QtGui.qApp.topLevelWidgets()
for i in toplevel:
if i.metaObject().className() == "Gui::MainWindow":
return i
raise Exception("No main window found")
mw=getMainWindow()
mw.hide()
#mw.showMinimized()
# Create a test geometry and add it to the document
obj=Part.makeCone(10,8,10)
doc = FreeCAD.newDocument()
Part.show(obj)
from PySide import QtGui
import FreeCADGui
def getMainWindow():
toplevel = QtGui.qApp.topLevelWidgets()
for i in toplevel:
if i.metaObject().className() == "Gui::MainWindow":
return i
raise Exception("No main window found")
mw=getMainWindow()
mw.hide()
#mw.showMinimized()
# Create a test geometry and add it to the document
obj=Part.makeCone(10,8,10)
doc = FreeCAD.newDocument()
Part.show(obj)
# switch off animation so that the camera is moved to the final position immediately
view = FreeCADGui.getDocument(doc.Name).activeView()
view.setAnimationEnabled(False)
view.viewAxometric()
view.fitAll()
view.saveImage('crystal.png',800,600,'Current')
FreeCAD.closeDocument(doc.Name)
# close the application
QtGui.qApp.quit()
view.setAnimationEnabled(False)
view.viewAxometric()
view.fitAll()
view.saveImage('crystal.png',800,600,'Current')
FreeCAD.closeDocument(doc.Name)
# close the application
QtGui.qApp.quit()
def makeSnapshotWithoutGui():
from pivy import coin