Collections:
editor.struct().atoms - Get Atom List
How to get a list of atoms currently in the Ketcher editor with the editor.struct().atoms property?
✍: FYIcenter.com
If you want to get a list of atoms currently in the Ketcher editor, 
you can use the editor.struct().atoms property on the Ketcher Editor interface.
Here is an HTML document that shows you how to get a list of atoms in Ketcher editor and print detailed information of the fist atom.
<html>
<!-- editor-get-first-atom.html Copyright (c) FYIcenter.com. -->
<head>
<title>Get the First Atom from Editor</title>
</head>
<body>
<p>Create a molecule structure, then click generate button below the editor:</p>
<iframe id=frmKetcher src="/ketcher/index.html"
  style="width: 680px; height: 400px;"></iframe>
<p><button onclick="generate();">Get the First Atom</button></p>
<p>Output:</p>
<pre id=output style="background-color: #ddd;"></pre>
<script>
  var ketcher = null;
  var display = document.getElementById("output");
function generate() {
  frm = document.getElementById("frmKetcher");
  ketcher = frm.contentWindow.ketcher;
  editor = ketcher.editor;
  structure = editor.struct();
  atoms = structure.atoms.entries();
  first = atoms.next().value;
  display.innerHTML = JSON.stringify(first, undefined, 2);
}
</script>
</body>
</html>
Open the above HTML document on your local Web server. Draw a benzene molecule in the editor.
Click "Get the First Atom" button, you will see that detailed information of the first atom of the structure in the editor is displayed.
[
  0,
  {
    "label": "C",
    "fragment": 1,
    "alias": null,
    "isotope": 0,
    "radical": 0,
    "cip": null,
    "charge": 0,
    "rglabel": null,
    "attpnt": null,
    "implicitHCount": null,
    "explicitValence": -1,
    "valence": 4,
    "implicitH": 1,
    "pp": {
      "x": 1.5746705613885816,
      "y": 2.574248795956401,
      "z": 0
    },
    "sgs": {},
    "ringBondCount": 0,
    "substitutionCount": 0,
    "unsaturatedAtom": 0,
    "hCount": 0,
    "aam": 0,
    "invRet": 0,
    "exactChangeFlag": 0,
    "rxnFragmentType": -1,
    "stereoLabel": null,
    "stereoParity": 0,
    "atomList": null,
    "neighbors": [
      13,
      16
    ],
    "badConn": false,
    "pseudo": ""
  }
]
⇒ editor.struct().bonds - Get Bond List
2023-12-01, 809🔥, 0💬
Popular Posts:
Molecule Summary: ID: FYI-1003646 Names: InChIKey: YMAOYJAKAGLHIJ-UHFFFAOYS A-NSMILES: Nc4noc5ccc(c1...
Molecule Summary: ID: FYI-1004136 Names: InChIKey: JAPXBYCNXQCTLN-UHFFFAOYS A-NSMILES: CCN(CC)CCCCNC...
Molecule Summary: ID: FYI-1002746 Names: InChIKey: HHTFGKSEYCDOAY-UHFFFAOYS A-NSMILES: NS(=O)(=O)c4c...
Molecule Summary: ID: FYI-1001184 SMILES: CC(C)(CCCC(=O)N(c1ccccc1 )c2ccccc2)c3ccc(Br)cc3Received at...
Molecule Summary: ID: FYI-1001888 SMILES: O=C(O)C5=C(O)C2=C(C=CC1= C(O)C=3C(=O)C4=C(O)C=C(O )C=C4(C(=O...