Hmm. I'm not sure that's an efficient solution.

Much easier to use evaluate, as it returns  the mathematical evaluation
directly. There should be no need to do anything with atoms. Also, you
would not want to use script(), as it is asynchronous. It is meant for the
applet and from user action, not for this sort of thing. You want


in JmolViewer:

  abstract public String scriptWait(String script);


  /**
   * @param returnType "JSON", "string", "readable", and anything else
returns the Java object.
   * @param infoType
   * @param paramInfo
   * @return            property data -- see
org.jmol.viewer.PropertyManager.java
   */
  abstract public Object getProperty(String returnType, String infoType,
Object paramInfo);

with returnType = null, infoType = "evaluate", and paramInfo your
expression.

The expression, for example, might be "3 + 5 * 8" or anything else that can
be used in the PRINT command.

The returned value will be an org.jmol.script.ScriptVariable, from which
its value can be extracted easily as its value or intValue.

So, for example:

import javajs.util.Lst
import org.jmol.script.SV

Lst<SV> xyzList = (Lst<SV>)  SV.oValue((SV)vwr.getProperty(null,
"variableInfo", "[{*}.x.max, {*}.y.max, {*}.z.max]")));
float xmax = ((Float) SV.oValue(xyzlist.get(0))).floatValue();
...etc

Bob
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to