Hello,

(first time here)

1) Is there a way to change the color of atoms from the python console..?
(that's my main question, but includes sub-questions as well)

Let's start in Avogadro's python console..

 > import Avogadro

now we have

 > Avogadro.molecules

which is a Avogadro.Molecule object, preloaded by the program

 > Avogadro.molecules.atoms[1]

.. that is the first atom in the system.  How do I change its color?

The thing is that I could probably figure this all out by myself, but 
the python console
of Avogadro - sorry for the expression - slightly sucks. I mean for example:

 > at=Avogadro.molecules.atoms[1]

Now consider

 > dir(at)

Does not give any list of methods or variables of the object "at". This 
makes it difficult
to "play around" (thats the way I learn, at least) with the methods, etc.

It would be ideal to do these things from the "ipython" console as it 
gives you the available methods by simply pressing
the tabulator.  I tried the following things in ipython:

----------------------
In [1]: import Avogadro

In [2]: Avogadro.molecules
Out[2]: <Avogadro.MoleculeList at 0x30d1130>

In [12]: Avogadro.Molecule.atoms.  [[ I PRESS THE TABULATOR ]]
Avogadro.Molecule.atoms.deleter  Avogadro.Molecule.atoms.fdel 
Avogadro.Molecule.atoms.fget     Avogadro.Molecule.atoms.fset 
Avogadro.Molecule.atoms.getter   Avogadro.Molecule.atoms.setter

In [12]: mymol=Avogadro.Molecule()
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-12-75e5a67f105c> in <module>()
----> 1 mymol=Avogadro.Molecule()

RuntimeError: This class cannot be instantiated from Python
---------------------

Is there a way to read in a coordinate file from the ipython console, 
using some method of the Avogadro class..?

This would facilitate the learning process ..
.. and reduce the amount of spam I am sending to this mailing list.


2) I am not able to change the color of the hydrogen bonds either.. I go 
to hydrogen bonds => hydrogen bond settings => colors => custom color
.. i change it to black .. nothing happens (its still ugly yellow).

Can I change this manually, i.e. like in question (1)  ?


3) In general, I am interested in the following..

a) Read a coordinate file to avogadro (btw, why doesn't it recognize 
".xmol" extension - its the same things as ".xyz" ?)
b) Meanwhile, manipulate that coordinate file with my custom python 
scripts to study various things .. (outside avogadro)
c) Color / draw bonds on the avogadro view, say, my own custom hydrogen 
bonds, etc.
     .. for this purpose, I need to connect somehow to all the methods 
and variables of avogadro via python


Regards,

Sampsa

P. S. I am using Avogadro 1.0.3


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Avogadro-Discuss mailing list
Avogadro-Discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-discuss

Reply via email to