Closed agrodet closed 2 years ago
Hi @agrodet, you may use the atom.linkedConnectors
property to retrieve all connectors linking to this atom. Aside from normal bonds, other types of connector may be included in this property too. If only bonds should be considered, the getLinkedBonds
method can be used here:
let bonds = atom.getLinkedBonds(); // retrieve all bonds
let covalenceBonds = atom.getLinkedBonds(Kekule.BondType.COVALENT); // retrieve only covalent bonds
I see! I didn't find it in tutorials, and was looking for properties. Should have checked the methods as well 😄
Thank you very much! Awesome library.
Hello, and thank you again for this repository. I have a simple question. Using
Bond.connectedObjs
, we can know whichAtom
are connected to a specificBond
. I would like to do the reverse: from a selectedAtom
, I would like to know theBond
it is connected to. Of course, by doing some algorithmic gymnastics, it is not so hard to go through allBond
to find the ones connected to the currently selectedAtom
. However, it is not very practical if one wants to "walk" the paths from the selectedAtom
. Is there any more direct way to go fromAtom
toBond
?