On Thu, Sep 15, 2011 at 10:13 AM, Martin Hediger <[email protected]> wrote:

> 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.
>

right, newPt


> 2) Is "fileContents" a valid property descriptor?
>

sure.



> 3) Where whould the file with the new data be written to? Relative to
> the location of the script containing the "replacePDBCoords" function.
>

probably the directory containing the JAR file.


> 4) Is 'write("PDB")' a way of telling Jmol, that the data has to be
> written in PDB format?
>

yes


> 5) What does the '@' do in "write var newData @outFileName"?
>
>
newData is the name of the variable that contains the data; outFileName is
the variable that contains the file name to be written to. After the file is
written, the Java console and Jmol console should both show the full path to
the file written.




> 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
>



-- 
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
------------------------------------------------------------------------------
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

Reply via email to