On Mon, Jan 30, 2012 at 6:17 PM, Ted Cohen <j...@monona.us> wrote:
> On Mon, January 30, 2012 18:04, Robert Hanson wrote:
> > show state/"set spin" which will give you just one line to parse.
> Very nice! I did not know that.
>
> It appears that I can use jmolGetPropertyAs.... in the javascript
> interface to get anything that is
> in the list of readonly variables plus about 300 more variables that are
> not exposed as readonly
> variables. Am I reading the documentation correctly? For a javascript
> programmer, isn't that
> a much better interface than echoing a readonly variable in a script call
> and waiting to pick
> up the retuened value in the messageCallback?
>
>
jmolGetProperty is indeed very powerful. It taps into a set of array data
for the model. Mostly it is good for atom-based information. I don't know
that it gets you these read-only variables. The easiest way to get them
from JavaScript is using jmolEvaluate:
var myJSvar = jmolEvaluate("_spinning")
for example. This function does the same as the "print' command, but
delivers the result directly back to the JavaScript.
--
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
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users