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, 818🔥, 0💬
Popular Posts:
Molecule Summary: ID: FYI-1002829 Names: InChIKey: OAVSBGYWDGCDEV-UHFFFAOYS A-NSMILES: CC34CCC2C1C=C...
Molecule Summary: ID: FYI-1000311 SMILES: Cc1ccc2c(c1)NC(=O)[C@H]( O2)C(=O)NCC(C)CReceived at FYIcen...
Molecule Summary: ID: FYI-1005395 Names: InChIKey: CMWKITSNTDAEDT-UHFFFAOYS A-NSMILES: O=Cc1ccccc1N(...
Right/Left Hand Stereo Centers? In chemstry study, a stereo center a labeled as R (Rectus, Right in ...
Molecule Summary: ID: FYI-1001184 SMILES: CC(C)(CCCC(=O)N(c1ccccc1 )c2ccccc2)c3ccc(Br)cc3Received at...