"from PyQt4 import QtGui,QtCore" returns an error message:
File "<input>", line 1, in <module>
ImportError: No module named PyQt4
I found riverbankcomputing.com, and their web page saying SIP must already be installed and built before installying PyQt4. Searching "PyQt4" in this forum returns overwhelming results. Then I found http://www.freecadweb.org/wiki/index.php?title=PyQt
saying FreeCAD switched to PySide. So I...
Edited the script to read "from PySide
import QtGui,QtCore" rather than "from PyQt4
An error message that I can not reproduce or remember occurred when I ctrl-v pasted the script into Pyton Console. So I put the script in a macro, which appeared to do nothing when ran as well as no error messages (previously it complained about PyQt4). Then restarted FreeCAD, loaded crank_simul.fcstd, and the graphics automatically animated with very rapid twitching between two crank angles (less than 180 degrees of each other) and slowly moving. I'm guessing if the solver was not twitching, it would produce a smooth graphic.
Looking to hide the script to confirm its whats running, I renamed "crank_simul.FCMacro" file
to something different, like crank_____simul.FCMacro, restarted and crank.fcstd loads without automatically animating. Manually running the newly named script started smoothly animating the graphics (after a wait for it to load). Renamed it back to "crank_simul.FCMacro", restarted and re-opened crank_simulate.fcstd, but it did not automatically load, and seems to work fine when manually running the script in a macro.
But, "animation.stop()" in the python console still produces: "NameError: name 'animation' is not defined"
and trying "my_animation = Animation()" in the python console, I get "NameError: name 'Animation' is not defined". Unlike when I type "App." in the console, which displays a list of properties - typing "application." does not produce a list of properties.
I am new to FreeCAD and Python.