Atom and bond index

User f5e6ccf034

05-06-2008 19:12:25

Apologies if this is right under my nose and I overlooked it but what are the converse of MoleculeGraph.getAtom/getBond(int) ?





Thanks

ChemAxon e500b51457

05-06-2008 20:36:00

Hello,





You can use CGraph.add(CNode node) or CGraph.add(CEdge edge) as inverse of getAtom(), getBond().





Regards,


Erika.

User f5e6ccf034

05-06-2008 21:29:13

But I don't want to add anything to the molecule: I want to find the serial index of an existing atom or bond that I got from some other method.

ChemAxon e500b51457

06-06-2008 07:57:19

In this case: the CGraph.indexOf(CEdge edge) gets the index of the bond,


CGraph.indexOf(CNode node) gets the index of the atom.

ChemAxon a9ded07333

06-06-2008 07:57:57

Hi,





I think you are looking for these methods:





index of an edge,



index of a node






Tamás