Switched TemplatePyMod scripts to PySide
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user