Bob,

OK, with 3 models in the window, I’m here:

[{nElements=6, numberInModel=1, mf=H 4 C 1, number=1, modelNumber=1.1, 
nAtoms=5}, {nElements=6, numberInModel=2, mf=H 4 C 1, number=2, 
modelNumber=1.1, nAtoms=5}, {nElements=9, numberInModel=3, mf=H 8 C 9 O 4, 
number=3, modelNumber=1.1, nAtoms=21}]

How do I extract the number of models?

Otis

--
Otis Rothenberger
o...@chemagic.org
http://chemagic.org

> On Mar 25, 2016, at 1:10 AM, Robert Hanson <hans...@stolaf.edu> wrote:
> 
> It's something about how I am converting these to JSON and then from there 
> evaluating them. Otis, here's something to sink your teeth into. Forget JSON 
> or JavaScript - now you can directly read that info as a "Java" object:
> 
> x = Jmol.getPropertyAsJavaObject(jmolApplet0,"moleculeInfo")
> 
> x.toString()
> 
> "[{nElements=16, numberInModel=1, mf=H 10 C 8 N 4 O 2, number=1, 
> modelNumber=1.1, nAtoms=24}]"
> 
> ok, so x is a JU.Lst:
> 
> x.get(0).toString()
> "{nElements=16, numberInModel=1, mf=H 10 C 8 N 4 O 2, number=1, 
> modelNumber=1.1, nAtoms=24}"
> 
> and that must be a java.util.Map:
> 
> x.get(0).get("mf")
> "H 10 C 8 N 4 O 2"
> 
> 
> What the heck!! Might as well use it directly. Looks like Java; behaves like 
> Java. But, actually, it's JavaScript.
> 
> 
> ​Bob
> 
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140_______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to