Export to SDFile from .net

User 1df2973830

11-09-2009 06:18:26

Is there a way to export the structures to SDFile along with some parameters from .net application (or even JAVA) ?

ChemAxon 909aee4527

14-09-2009 08:48:08

Hi,


yes it is possible, we are preparing an example code and post it here soon.


Since this week is our US UGM, this might take a bit more time than usual, I hope this is not a problem.


Kind regards,
Judit

ChemAxon 909aee4527

15-09-2009 12:53:08

We are sorry for the delay of the answer.


Supposing you already have a molecule with some properties, the following code can be used from a .NET application (even though it looks like a Java code) with the JChem API:


   java.io.File file = new java.io.File("c:/test/sdfTest.sdf");
   file.getParentFile().mkdirs();
   java.io.FileOutputStream os = new java.io.FileOutputStream(file);
   chemaxon.struc.Molecule mol = new chemaxon.struc.Molecule();
   chemaxon.formats.MolExporter molExporter = new chemaxon.formats.MolExporter(os, "sdf");
   molExporter.write(mol);
   molExporter.close();


In case this is not sufficient to achieve what you need please give us some more information.


Kind regards,
Judit