In Jmol math you can "drill down" into properties by adding parameters 
rather than using the dot notation.

nModels = getProperty("modelInfo","modelCount")

does what you want. If you know there is only one file loaded, but it 
might have multiple models, AND you know they are numbered sequentially 
starting with 1, so that the highest model number is the model count, 
then this will work:

nModels = {*}.model.max

similarly, if there is a sequential array, as there is here:

print getproperty("modelInfo","models",3,"file")

gives you the file for the third model. (Zero there instead of 3 would 
give you information about the LAST model, -1 would be for the NEXT TO 
LAST model, etc.)

It's not exactly obvious, but by looking at the full output for 
modelInfo you might be able to guess what parameters you will need. 
"models" is listed as a Vector[3], each of which includes a number of 
items.

Ah, I have a great idea. We should be able to do this using the 
following notation:

print getProperty("modelInfo.models[3].file")

Let me see if I can implement that.

modelinfo   
modelSetHasVibrationVectors    false
modelCount    3
modelSetName    "1CDR"
modelSetProperties   
PATH_SEPARATOR    ";"
PATH_KEY    ".PATH"

models    Vector[3]   
atomCount    1269
_ipt    0
name    "1"
bondCount    1289
file_model    "1.1"
polymerCount    2
file    "C:\jmol-dev\workspace\Jmol\bobtest\1.pdb"
chainCount    1
num    1
vibrationVectors    false
title    "1CDR"
groupCount    80
,
atomCount    1269
_ipt    1
name    "2"
bondCount    1289
file_model    "1.2"
polymerCount    2
file    "C:\jmol-dev\workspace\Jmol\bobtest\1.pdb"
chainCount    1
num    2
vibrationVectors    false
title    "1CDR"
groupCount    80
,
atomCount    725
_ipt    2
name    "5"
bondCount    737
file_model    "1.3"
polymerCount    1
file    "C:\jmol-dev\workspace\Jmol\bobtest\1.pdb"
chainCount    1
num    5
vibrationVectors    false
title    "1CDR"
groupCount    49




Bob

Rolf Huehne wrote:

>      Hi,
>
>I would like to use the Jmol math 'getProperty("modelInfo")' function to
>get information on the currently loaded models within the application.
>
>But I couldn't figure out how to access specific information like the
>'modelCount' after the following command within Jmol 11.5.35:
>
>  modelInfo = getProperty("modelInfo");
>
>When I print the whole content with 'print modelInfo', I get a long list
>of information. I tried for example 'count = modelInfo.modelCount' but
>got an error message.
>When I tried to access 'modelInfo' like an array, I only got single
>letters back.
>
>Regards,
>Rolf
>
>-------------------------------------------------------------------------
>This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>Build the coolest Linux based applications with Moblin SDK & win great prizes
>Grand prize is a trip for two to an Open Source event anywhere in the world
>http://moblin-contest.org/redirect.php?banner_id=100&url=/
>_______________________________________________
>Jmol-users mailing list
>Jmol-users@lists.sourceforge.net
>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



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to