Hello,
(first time here)
- 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)
in ()
----> 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.
- 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) ?
- 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