Collections:
editor.struct() - Get Entire Structure
How to get the entire structure currently in the Ketcher editor with the editor.struct() method?
✍: FYIcenter.com
If you want to get detailed information
about the entire structure currently in the Ketcher editor,
you can call the editor.struct() method on the Ketcher Editor interface.
Here is an HTML document that shows you how to get detailed information from the structure in Ketcher editor:
<html>
<!-- editor-get-entire-structure.html Copyright (c) FYIcenter.com. -->
<head>
<title>Get Chemical Structure 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 Entire Structure</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();
display.innerHTML = JSON.stringify(structure, undefined, 2);
}
</script>
</body>
</html>
Open the above HTML document on your local Web server. Draw a benzene molecule in the editor.
Click "Get Entire Structure" button, you will see that detailed information of the structure in the editor is displayed.
{
"atoms": {
"nextId": 6
},
"bonds": {
"nextId": 6
},
"sgroups": {
"nextId": 0
},
"halfBonds": {
"nextId": 0
},
"loops": {
"nextId": 0
},
"isReaction": false,
"rxnArrows": {
"nextId": 0
},
"rxnPluses": {
"nextId": 0
},
"frags": {
"nextId": 1
},
"rgroups": {
"nextId": 0
},
"name": "",
"abbreviation": "",
"sGroupForest": {
"parent": {},
"children": {},
"atomSets": {}
},
"simpleObjects": {
"nextId": 0
},
"texts": {
"nextId": 0
},
"functionalGroups": {
"nextId": 0
},
"highlights": {
"nextId": 0
}
}
⇒ editor.struct().atoms - Get Atom List
2023-12-08, 998🔥, 0💬
Popular Posts:
Molecule Summary: ID: FYI-1002297 Names: InChIKey: ZFGCWYTXGWTIFX-YCRREMRBS A-NSMILES: Cc2cc3/C(C(=O...
Molecule Summary: ID: FYI-1005855 Names: InChIKey: RHHMBPMWRHDFAV-ZHDDOTHNS A-NSMILES: CN(Cc1ccccc1)...
Molecule Summary: ID: FYI-1000190 SMILES: Cc1cc(C)n2nc(C(=O)N/N=C/ c3ccc4c(c3)OCO4)nc2n1Received at ...
Molecule Summary: ID: FYI-1003176 Names: InChIKey: UNXHWFMMPAWVPI-ZXZARUISS A-NSMILES: OC[C@H](O)[C@...
Molecule Summary: ID: FYI-1005567 Names: InChIKey: AUDDTOOAJOMLPW-UHFFFAOYS A-NSMILES: Cc3cc(=O)oc4c...