Collections:
editor.struct().bonds - Get Bond List
How to get a list of bonds currently in the Ketcher editor with the editor.struct().bonds property?
✍: FYIcenter.com
If you want to get a list of bonds currently in the Ketcher editor, you can use the editor.struct().bonds property on the Ketcher Editor interface.
Here is an HTML document that shows you how to get a list of bonds in Ketcher editor and print detailed information of the fist bond.
<html> <!-- editor-get-first-bond.html Copyright (c) FYIcenter.com. --> <head> <title>Get the First Bond 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 Bond</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(); bonds = structure.bonds.entries(); first = bonds.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 Bond" button, you will see that detailed information of the first bond of the structure in the editor is displayed.
[ 0, { "begin": 2, "end": 0, "type": 2, "xxx": " ", "stereo": 0, "topology": 0, "reactingCenterStatus": 0, "cip": null, "len": 40.028581715494084, "sb": 10, "sa": 16.014290857747042, "angle": 150.01650970082835, "center": { "x": 1.2432867229912992, "y": 0.5500640451937939, "z": 0 }, "hb1": 0, "hb2": 1 } ]
⇒ editor.struct().loops - Get Loop List
2023-12-01, 235🔥, 0💬
Popular Posts:
Molecule Summary: ID: FYI-1002478 Names: InChIKey: KMZHZAAOEWVPSE-UHFFFAOYS A-NSMILES: CC(=O)OCC(O)C...
Where to find FAQ (Frequently Asked Questions) on molecule online tools? I want to use them to creat...
How to specify Input Data Source and Format for a "babel" command? "babel" command arguments and opt...
Molecule Summary: ID: FYI-1001935 SMILES: OC[C@H]1O[C@H]([C@@H]([C @H]([C@@H]1O)O)O)c1c(O)c ccc1ORece...
Molecule Summary: ID: FYI-1000942 SMILES: O=C4N=C(NC23CC1CC(CC(C1) C2)C3)SC45CCC5Received at FYIcent...