I implemented your script for saving some coordinates (below) of a
reoriented model (from rotateSelected).
Questions
1) I believe there is a syntax error, it should read newData[newpt++],
instead of newData[pt++]. Right?.. sorry for the question, its not
prefectly obvious to me what is happening, even if the rest is
understandable.
2) Is "fileContents" a valid property descriptor?
3) Where whould the file with the new data be written to? Relative to
the location of the script containing the "replacePDBCoords" function.
4) Is 'write("PDB")' a way of telling Jmol, that the data has to be
written in PDB format?
5) What does the '@' do in "write var newData @outFileName"?
Thanks for your help.
Martin
The Jmol script would look something like this:
>
> function replacePDBCoords(outFileName) {
> var oldData = getProperty("fileContents")
> var atomData = write("PDB")
> var newData = [ ]
> var newpt = 1
> var atompt = 1
> for (var i = 1; i <= oldData.length; i++) {
> var line = oldData[i]
> newData[pt++] = (find(line, "ATOM") == 1 || find(line,"HETATM") == 1
> ? atomData[atompt++] : line)
> }
> write var newData @outFileName
> }
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops? How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users