Hi Tom,Thanks a lot for your reply!I actually need to use both... I use 'distance' to measure the distance between two points representing centers of mass. And I use 'measure distance' to measure the distance between an atom and a molecule. (I also use 'measure center ... mark true' to get the points of centers of mass, but I do not necessarily need the result in Python).Thanks for the Python command for 'distance'! Could you also point me to the command for 'measure distance'? Is there a way to find Python alternatives for an arbitrary Chimera commands?Thanks!AlexOn 14 November 2014 02:40, Tom Goddard <goddard@sonic.net> wrote:Sure here is the distance between two atoms.
import Midas
d = Midas.distance('#1:395.A@CA #0:29.F@CA’)
I don’t know what you are doing since “distance #1 #2” won’t work unless each of those models is only one atom. And of course “measure distance” is a different command and has a different Python call to access it. Please be specific about what you need. I don’t want to guess all the different possibilities of what you are trying to measure the distance between.
Tom
> _______________________________________________
On Nov 12, 2014, at 12:41 PM, Alex Voronov wrote:
> Hi,
>
> I'm measuring distance between two points. The measurement goes well and I get a correct value in the viewport. I would like to get the same value into a Python variable. Is it possible?
>
> I'm thinking about a code like this:
>
> d = chimera.runCommand('distance #1 #2')
>
> However, it seems to be impossible to get any value from runCommand, I always get None...
>
> Even parsing the log that appears in IDLE from commands 'distance #1 #2' or 'measure distance #1 #2' would sort-of work, but I don't know how to capture the log either...
>
> Is there a way to get values into variables from 'measure distance'?
>
> Thank you!
>
> Alex
> Chimera-dev mailing list
> Chimera-dev@cgl.ucsf.edu
> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev