OK, if you have ever wanted to get atom information from a file, this is 
for you. The following command would be given from a web page:


var info = "" + jmolGetPropertyAsJavaObject("evaluate",
    '"" + {molecule=1} + "\n\n" + {molecule=1}.label("%a %x %y %z")'
    )
  
The new thing here is the "evaluate" option. It says, "Return what you 
get when you evaluate the expression:

"" + {molecule=1} + "\n\n" + {molecule=1}.label("%a %x %y %z")


Believe it or not, this single command delivers a fully valid XYZ file 
for a subset of the model. The variable "info" would contain, perhaps:

3

O 0.00000000 0.00000000 -0.11460000
H -0.75400000 0.00000000 0.45840000
H 0.75400000 0.00000000 0.45840000


Here's how it works:

"" + {molecule=1} + "\n\n" + {molecule=1}.label("%a %x %y %z")

is going to be evaluated:

""             means "turn anything after this into a string"
+ {molecule=1} means "the number of atoms in molecule 1"
+ "\n\n"       means "then two line feeds (a blank line)"

and then

+ {molecule=1}.label("%a %x %y %z")

adds for each atom in the first molecule a label consisting of an atom 
name, x, y, and z coordinate. That's the XYZ format.

I think I'll stop here and wait for reaction to all of this. I know it's 
been a flurry of activity. But I think you can see that already it is 
quite powerful. You can check it out for yourself at:

http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/new.htm

I look forward to see what people do with this.


Bob



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to