|
The "Jython Console" application module enables one to write small programs in
the Python programming language to control
Modelzilla and Modelzilla applications.
Jython is an implementation of Python that
runs within the Java environment. (Jython generates Java bytecode based on a
Python source file.)
Here is a link to the Python manual.
Rather than include Jython support in the Modelzilla framework, it is packaged
as an application module, so that there is no Jython dependency in the framework.
Over the past few years, we have experimented with Jython, resulting in
some Jython dependencies being sprinkled around the Modelzilla code. This has
all been removed as of the release of the "Jython Console" ap-mod. The Java-based
framework now has nothing to do with Python.
A scripting system is useful for:
-
Automating repetitive assemblies. This especially relevant to CAD work. Often
many similar objects need to be created, for example 50 circles with computed
radii, that are a pain to enter with the interactive GUI.
-
Building high level templates. In CAD work it is great to be able to create
a template object such like a bracket and parameterize it to control such things
as the screw hole diameter and overall width and height. This allows you to quickly
make many similar versions of the bracket.
-
Doing animations. It is possible to write a loop that modifies parameters in
the Modelzilla database, causes a redraw after each set of modifications and
does an image dump.
-
Debugging. It is handy to use Jython to print out the state of various objects
under debugging scrutiny.
|