That's true -- the getProperty method bypasses the script processor.

Try

x = jmolScriptWait('print getProperty("boundboxInfo")')

This returns a string rather than an array, but you should be able to 
parse it easily, and also you can target exactly the info you want:

x = jmolScriptWait('print getProperty("boundboxInfo","center")')

-- btw -- you really should be using jmolScript, not applet.script -- 
some reason for doing that?


Bob

rob yang wrote:

>Hi Jmol users and developers,
>I ran into an interesting problem when I am trying to update the current info 
>about the boundbox using the getProperty() function. What happened was that 
>getProperty() seems to return the value before the applet finishes setting up. 
>I am showing a simplified snippet of my code below to better illustrate:
>---
>document.getElementById("applet").script("center all; set boundbox{all} on;");
>//alert("delay"); 
>var box = document.getElementById("applet").getPropertyAsJSON("boundInfo");
>alert(box);
>---
>
>Now, with the alert("delay") commented out, my alert(box) line returns the 
>default values having boundbox center being 0,0,0 and vector being 10,10,10. 
>However, with the alert("delay") line in, the alert(box) line returns the 
>different values that reflects the real center which depends on what molecules 
>are loaded.
>
>So, it appears that the getProperty() function and the applet.script(...) are 
>out of sync. Any suggestions?
>
>-Rob
>_________________________________________________________________
>If you like crossword puzzles, then you'll love Flexicon, a game which 
>combines four overlapping crossword puzzles into one!
>http://g.msn.ca/ca55/208
>-------------------------------------------------------------------------
>Check out the new SourceForge.net Marketplace.
>It's the best place to buy or sell services for
>just about anything Open Source.
>http://sourceforge.net/services/buy/index.php
>_______________________________________________
>Jmol-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>  
>


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


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



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to