At the end I left it like this (without script inline):
function crossMeasure(atomListN, atomListM){
    set measurementUnits angstroms
    set measurements 3
    font measure 16 serif bold
    var n = atomListM.length
    for (var i = 2; i <= n; i++) {
        measure @{atomListN[1]} @{atomListM[i]}
    }
}

function DELcrossMeasure(atomListN, atomListM){
    var n = atomListM.length
    for (var i = 2; i <= n; i++) {
        measure delete @{atomListN[1]} @{atomListM[i]}
    }
}


And I call it like:
$contenuto2 .= '<td><script>
   jmolCheckbox("crossMeasure({'.$select_r.'.ca},{'.$select_rmodel.'.ca})",
"DELcrossMeasure({'.$select_r.'.ca},{'.$select_rmodel.'.ca})", "");
</script></td></tr>';


It would be nice to show the measure results anyhow, because when there are
more than 2 homology models, it is hard to see the distance number (and also
because I use some labels). Any way to show the measure results is ok,
either as an "echo", an "alert", or in a message box like in the
documentation examples. Which is the easiest way? Thanks a lot!
Daniel





2011/3/31 Robert Hanson <hans...@stolaf.edu>

> sure, but you wouldn't do that inside the for loop. I think you are
> confusing Jmol script and JavaScript. First, let's get the crossMeasure
> working. What's the final form of that that works?
>
>
> On Thu, Mar 31, 2011 at 4:48 AM, Daniel Carbajo 
> <daniel.carb...@gmail.com>wrote:
>
>> Thanks Bob, but I cannot make it work as an echo; if you remember the
>> function you have helped me with these last days, I want to modify it so it
>> looks something like this
>>
>> function crossMeasure(atomListN, atomListM){
>>     set measurementUnits angstroms
>>     set measurements 3
>>     font measure 16 serif bold
>>
>>     set echo top left
>>     font echo 20 serif bolditalic
>>     color echo green
>>
>>     var n = atomListM.length
>>     for (var i = 2; i <= n; i++) {
>>         measure @{atomListN[1]} @{atomListM[i]}
>>
>>         var a =
>> jmolGetPropertyAsArray('measurementInfo')[0].strMeasurement
>>         echo append a ????
>>     }
>> }
>>
>> Is something like that possible?
>>
>>
>> 2011/3/31 Robert Hanson <hans...@stolaf.edu>
>>
>>> Check this out:
>>>
>>>
>>> jmolEvaluate('getProperty("measurementInfo")')
>>>
>>> this gives you the overall format of the measurementInfo data.
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Mar 30, 2011 at 8:46 AM, Daniel Carbajo <
>>> daniel.carb...@gmail.com> wrote:
>>>
>>>> Hello everybody,
>>>> does any of you know if it is possible to display the output of "show
>>>> measurements" as an "echo" when using the jmol applet in a php page?
>>>> Alternatively, do you know how to show a message box like in the
>>>> documentation pages (like in
>>>> http://chemapps.stolaf.edu/jmol/docs/examples-11/measure.htm).
>>>> Or, as another alternative, how to use
>>>> javascript:alert(jmolGetPropertyAsArray('measurementInfo')) which I cannot
>>>> make work...
>>>> Thanks a lot!
>>>> Daniel
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Enable your software for Intel(R) Active Management Technology to meet
>>>> the
>>>> growing manageability and security demands of your customers. Businesses
>>>> are taking advantage of Intel(R) vPro (TM) technology - will your
>>>> software
>>>> be a part of the solution? Download the Intel(R) Manageability Checker
>>>> today! http://p.sf.net/sfu/intel-dev2devmar
>>>> _______________________________________________
>>>> 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
>>> 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
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Create and publish websites with WebMatrix
>>> Use the most popular FREE web apps or write code yourself;
>>> WebMatrix provides all the features you need to develop and
>>> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>>>
>>>
>>> _______________________________________________
>>> Jmol-users mailing list
>>> Jmol-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Create and publish websites with WebMatrix
>> Use the most popular FREE web apps or write code yourself;
>> WebMatrix provides all the features you need to develop and
>> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>>
>> _______________________________________________
>> 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
> 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
>
>
> ------------------------------------------------------------------------------
> Create and publish websites with WebMatrix
> Use the most popular FREE web apps or write code yourself;
> WebMatrix provides all the features you need to develop and
> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to