Hi,
I'd like to output my molecules to svg with some options (e.g. implicit
hydrogen). Here's a minimal example code:
#include <openbabel/obconversion.h>
#include <openbabel/mol.h>
#include <iostream>
using namespace std;
using namespace OpenBabel;
int main() {
stringstream inputSmiles("CCC(CC)C");
ofstream pic("minimal_conversion_pic.svg");
OBConversion conv(&inputSmiles, &pic);
conv.SetInAndOutFormats("can", "svg");
OBMol mol;
conv.Read(&mol);
mol.AddHydrogens();
conv.AddOption("C",OBConversion::OUTOPTIONS);
conv.Write(&mol);
}
I believe "C" is an option to turn off explicit hydrogen in svg drawing.
However this program still prints hydrogens. I tried other options too but
none of them worked. Am I using AddOption wrong?
Thank you,
Xianghai
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss