Keep trying! More clear, I think:
var jmolEval = 'getProperty("auxiliaryInfo.models[' + i + '].modelname") ';
var Energy = parseFloat(jmolEvaluate(jmolEval,divInc).split("=")[2]);
????
>
> ***********************************************
> Jeff Hansen
> Department of Chemistry and Biochemistry
> DePauw University
> 602 S. College Ave.
> Greencastle, IN 46135
> [EMAIL PROTECTED]
> ***********************************************
>
>
> On Oct 22, 2008, at 7:18 PM, Robert Hanson wrote:
>
> Ah, yes. That's right.
>
> Well, easiest way is with split() and parseFloat() JavaScript:
>
> var modelName =
> parseFloat(jmolEvaluate('getProperty("auxiliaryInfo.models[1].modelname")').split("=")[2])
>
> for kcal,
>
> var modelName =
> parseFloat(jmolEvaluate('getProperty("auxiliaryInfo.models[1].modelname")').split("=")[3])
>
> for kJ.
>
> On Wed, Oct 22, 2008 at 6:07 PM, Jeff Hansen <[EMAIL PROTECTED]> wrote:
>
>> divInc increments so this will do a different applet (each in a different
>> div, thus divInc to increment which div it is in) when there are multiple
>> applets on the page.
>>
>>
>> that's
>>
>> var modelName =
>> jmolEvaluate('getProperty("auxiliaryInfo.models[1].modelname")')
>>
>> for the first model, [2] for the second model, etc.
>>
>>
>>
>> this gives me:
>>
>> Energy = Profile.1 HEAT OF FORMATION = -5.07597 KCAL = -21.23787 KJ kJ/mol
>>
>> How do I get just the number?
>>
>> Oh, and as you thought, models[0] gives model 24 and models[1] gives model
>> 1 even though they are labeled 0 thru 23 in the auxiliaryInfo.
>>
>>
>> ***********************************************
>> Jeff Hansen
>> Department of Chemistry and Biochemistry
>> DePauw University
>> 602 S. College Ave.
>> Greencastle, IN 46135
>> [EMAIL PROTECTED]
>> ***********************************************
>>
>>
>> On Oct 22, 2008, at 4:40 PM, Robert Hanson wrote:
>>
>> // var Energy =
>>> jmolEvaluate('getProperty("auxiliaryInfo.zeropoint")',divInc);
>>>
>>
>> if "divInc" is "0", that should work. Works for me. What is divInc? What
>> is the name of your applet?
>>
>>
>>
>>>
>>> Please note the line that is commented out. That line doesn't work. It
>>> returns an error message.
>>>
>>
>>
>>>
>>>
>>> If I use a .xyz file also exported from Spartan it contains a HEAT OF
>>> FORMATION. I've copied a portion of the auxiliaryInfo below to show this.
>>> I can't figure out how to pull that data out. This is the file format I
>>> would probably most like to use as I can output a multiple model .xyz file
>>> from Spartan relatively easily.
>>>
>>> 'models' ... '0' ... 'modelName' => "Profile.1 HEAT OF FORMATION =
>>> -5.07597 KCAL = -21.23787 KJ"
>>>
>>
>> Hmm. I don't know about that 0 there. In general, with xyz files, you
>> would have that information one per model, and [1] would be the first one.
>> [0] refers to the last model. '0' is really there, huh?
>>
>> that's
>>
>> var modelName =
>> jmolEvaluate('getProperty("auxiliaryInfo.models[1].modelname")')
>>
>> for the first model, [2] for the second model, etc.
>>
>>
>>> So I have two questions. First, how to get the heat of formation number
>>> out. Second, how to tell the applet which model to get the energy of.
>>>
>>
>>
>>
>>
>>
>>>
>>> ***********************************************
>>> Jeff Hansen
>>> Department of Chemistry and Biochemistry
>>> DePauw University
>>> 602 S. College Ave.
>>> Greencastle, IN 46135
>>> [EMAIL PROTECTED]
>>> ***********************************************
>>>
>>>
>>> On Oct 20, 2008, at 2:06 PM, Robert Hanson wrote:
>>>
>>> Right -- it depends upon the file type. I would use the one the
>>> originating program reports.
>>>
>>>
>>>
>>> On Mon, Oct 20, 2008 at 11:58 AM, Jeff Hansen <[EMAIL PROTECTED]>wrote:
>>>
>>>> I've gotten myself to a point where I need a little help. What I
>>>> would like to do is load a multiple model file into Jmol then pull out
>>>> of the file the energy of each model. Here is the function I have so
>>>> far:
>>>>
>>>> function getEnergy() {
>>>> var _jmolText = document.getElementById('jmolText');
>>>> var model = divInc + ".0";
>>>> var Energy =
>>>> jmolEvaluate('getProperty("auxiliaryInfo.zeropoint")',divInc);
>>>> var text = "Energy = " + Energy + " kJ/mol\n";
>>>> var node = document.createTextNode(text);
>>>> _jmolText.appendChild(node);
>>>> }
>>>>
>>>> I guess I have two questions. First, this function is getting the
>>>> zero point energy, but when I look at all the auxiliary info there are
>>>> other things that look like energy like E_KCAL or HEAT OF FORMATION.
>>>> What is there depends on the file type. So I'm asking which of these
>>>> do you think I should use? It is probably going to vary depending on
>>>> file type because different filetypes have different one's of these.
>>>> I'm sure I'm showing my ignorance here, but I don't really understand
>>>> the differences between all of these. Second, the code above gets one
>>>> value of the zeropoint energy. I need to get a different energy for
>>>> each model in the file. My code says which Jmol applet to get it
>>>> from, but how do I tell it which model of that file to get the energy
>>>> of?
>>>>
>>>>
>>>> ***********************************************
>>>> Jeff Hansen
>>>> Department of Chemistry and Biochemistry
>>>> DePauw University
>>>> 602 S. College Ave.
>>>> Greencastle, IN 46135
>>>> [EMAIL PROTECTED]
>>>> ***********************************************
>>>>
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>> challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win great
>>>> prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>> world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> Jmol-users mailing list
>>>> Jmol-users@lists.sourceforge.net
>>>> 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 the Moblin Your Move Developer's
>>> challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great
>>> prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>> world
>>>
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
>>> Jmol-users mailing list
>>> Jmol-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>> challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great
>>> prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>> world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Jmol-users mailing list
>>> Jmol-users@lists.sourceforge.net
>>> 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 the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>>
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
>> Jmol-users mailing list
>> Jmol-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Jmol-users mailing list
>> Jmol-users@lists.sourceforge.net
>> 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 the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
>
> http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> 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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users