Collections:
editor.struct().loops - Get Loop List
How to get a list of loops currently in the Ketcher editor with the editor.struct().loops property?
✍: FYIcenter.com
If you want to get a list of loops currently in the Ketcher editor,
you can use the editor.struct().loops property on the Ketcher Editor interface.
Here is an HTML document that shows you how to get a list of loops in Ketcher editor and print detailed information of the fist loop.
<html>
<!-- editor-get-first-bond.html Copyright (c) FYIcenter.com. -->
<head>
<title>Get the First Loop 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 Loop</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();
loops = structure.loops.entries();
first = loops.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 Loop" button, you will see that detailed information of the first loop of the structure in the editor is displayed.
[
0,
{
"hbs": [
0,
4,
8,
10,
2,
6
],
"dblBonds": 3,
"aromatic": false,
"convex": true
}
]
⇒ editor.structSelected() - Get Selected Sub-Structure
2023-11-23, 871🔥, 0💬
Popular Posts:
Molecule Summary: ID: FYI-1000463 SMILES: c12c([C@H]([C@@H]([C@H]( O1)c1ccc(c(c1)O)O)O)c1c3 c([C@@H]([...
Molecule Summary: ID: FYI-1001069 SMILES: C.C[C@H]1CCN2CCCNC2=[NH+ ]1.CCSC[C@H]1CCN2CCCNC2= [NH+]1.NC(...
Molecule Summary: ID: FYI-1000173 SMILES: CC(C)N(C)C(=O)c2ccc(C#CC Cc1ccc(Cl)cc1)cc2Received at FYIc...
Molecule Summary: ID: FYI-1000322 SMILES: C[C@@H](Cn1cccn1)N[C@H]2 CCOC2=OReceived at FYIcenter.com ...
Molecule Summary: ID: FYI-1003601 Names: InChIKey: VZMTZOXNCWXPEM-UHFFFAOYS A-NSMILES: Cn1nccc1c2cc(...