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, 1079🔥, 0💬
Popular Posts:
Molecule Summary: ID: FYI-1003882 Names: InChIKey: RETHHKSRJRNGJY-UHFFFAOYS A-NSMILES: c4ccc3cc(c2cc...
Molecule Summary: ID: FYI-1000963 SMILES: CN(C)CCN1C(=O)CSC1=S Received at FYIcenter.com on: 2021-08...
Molecule Summary: ID: FYI-1003948 Names: InChIKey: GLJUGYWQIUBONE-UHFFFAOYS A-NSMILES: CCc5nc(C(N)=O...
Molecule Summary: ID: FYI-1005531 Names: InChIKey: KVYWDANIDGXUSK-UHFFFAOYS A-NSMILES: c1cc2cc3c1cc2...
Molecule Summary: ID: FYI-1002250 Names: InChIKey: ZLCZNEYXYCUPKY-UHFFFAOYS A-NSMILES: CC(CCC(=O)O)C...