Closed akulmehta closed 5 years ago
Nevermind here is the solution:
//get the molecule object from the chemComposer widget
var molecule = chemComposer.getChemObj();
//get the smiles :)
var smiles = Kekule.IO.saveFormatData(molecule, 'smi')
Firstly, thank you for creating this. I have implemented the Kekule Chem Composer to draw the structures. I know the easy way of getting SMILES is to go to the save button and then selecting SMILES output. However, I would like to get the SMILES programmatically, i.e. avoiding the user to need to do this mannually. Is there a function which we can call to get the SMILES for a structure drawn in the editor? The idea is to pass the SMILES to search pubchem api to retrieve information about the structure drawn.