OK! Now that's getting creative! :)
There is a simpler way. The command
show frames all
gets you code that can be directly evaluated in JavaScript or parsed some
other way:
file["1.1"] = "C:\\jmol-dev\\workspace\\Jmol\\bobtest\\water-g03w.out"
title["1.1"] = ""
name["1.1"] = "E(RHF) = -76.0107464887 A.U."
file["1.2"] = "C:\\jmol-dev\\workspace\\Jmol\\bobtest\\water-g03w.out"
title["1.2"] = ""
name["1.2"] = "E(RHF) = -76.0107464887 A.U."
Also, the Jmol variable _modelName is the name of the current model.
print _modelName
E(RHF) = -76.0107464887 A.U.
Bob
On Wed, Apr 8, 2009 at 11:40 AM, Jeff Hansen <[email protected]> wrote:
> I did something similar recently only I used xyz files. The relevant
> code is below. You can see it in action at:
>
> http://web.me.com/jhansen4/iWeb/Jmol/NewJmolDiv.html
>
>
> code snippet:
>
> function getEnergies() {
> EnergyArray = new Array();
> var _jmolText = document.getElementById('jmolText');
> _jmolText.value = "";
> var modelInfo = jmolGetPropertyAsArray("modelInfo");
> var modelCount = modelInfo.modelCount;
> for (var i = 1; i <= modelCount; i++)
> {
> var jmolEval =
> 'getProperty("auxiliaryInfo.models['+i+'].modelname")';
> EnergyArray[i] =
> parseFloat(jmolEvaluate(jmolEval,divInc).split("=")
> [2]);
> var text = "Energy = " + EnergyArray[i] + " kJ/mol\n";
> _jmolText.value = _jmolText.value + text;
> }
> }
>
> in the code jmolText is the divID of the text area for displaying the
> energies, divInc is an id for the particular jmol applet (out of more
> than one on the page)
>
> Perhaps you can adapt this for your purposes. Let me know if you have
> any questions about it.
>
>
> ***********************************************
> Jeff Hansen
> Department of Chemistry and Biochemistry
> DePauw University
> 602 S. College Ave.
> Greencastle, IN 46135
> [email protected]
> ***********************************************
>
>
> On Apr 8, 2009, at 9:54 AM, Andrew R Turner wrote:
>
> >
> > Hi,
> >
> > I have probably missed a really simple way to do this but I have been
> > trying for a while now with no success so I thought I would ask.
> >
> > I have an Jmol applet that loads the results of Gaussian calculations
> > (*.log files). I notice that in the pop-up menu the list of models has
> > the energy for the configuration appended (something like 'E(RHF) =
> > ...'). What I want to do is create a button on the page that displays
> > this string in the applet window next to the current model.
> >
> > I have attempted various combinations of jmolGetPropertyAsArray and
> > scoured the documentation to no avail. Does anyone know how I might do
> > this?
> >
> > Cheers
> >
> > Andy
> >
> > ========================================
> > Dr Andrew R. Turner
> > e: [email protected]
> > t: +44 (0)131 651 3578
> > p: Edinburgh Parallel Computing Centre
> > University of Edinburgh
> > EH9 3JZ
> > ========================================
> >
> > --
> > The University of Edinburgh is a charitable body, registered in
> > Scotland, with registration number SC005336.
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > This SF.net email is sponsored by:
> > High Quality Requirements in a Collaborative Environment.
> > Download a free trial of Rational Requirements Composer Now!
> > http://p.sf.net/sfu/www-ibm-com
> > _______________________________________________
> > Jmol-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users