Thanks Noel, it works well.
Also i was interested in generating svg without background. I haven't
found any doc about it so i modified the svg text by replacing
fill="white" (or black) by fill="none" in the line :
|'<rect x="0" y="0" width="100" height="100" fill="white"/>'|
Although it is not elegant, it works. Hope it will help others.
Le 14/04/2013 15:39, Noel O'Boyle a écrit :
-xd is conv.AddOption("d", c.OUTOPTIONS)
-d is molecule.OBMol.DeleteHydrogens() (or mol.removeh())
We should document this, to make it easier to translate from obabel
options to code.
- Noel
On 12 April 2013 15:32, Quentin Delettre <quentin.delet...@gmail.com> wrote:
Hi,
I would like to generate svg for a molecule, inside a python script.
I use this code
...
c = ob.OBConversion()
c.SetOutFormat("svg")
c.AddOption("d", c.OUTOPTIONS, "1")
c.WriteFile(molecule.OBMol,"molecule.svg")
but can't find the way to obtain the molecule with implicit hydrogens like
the command :
obabel -i sdf molecule.sdf -o svg -O molecule.svg -xC -xd -d
Can you help me ?
Thanks
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss