Re: [Open Babel] Java bindings: OBMol.SetData()

2012-09-18 Thread Jon Fuller
Thanks very much. Problem solved. As a point of interest (it is also noted in the wiki). I needed to use: OBCommentData commentBack = openbabel_java.toCommentData(mol.GetData("cmt")); instead of: OBCommentData commentBack = (OBCommentData) mol.GetData("cmt"); Best, Jon On 17 September 2012 16:

Re: [Open Babel] Java bindings: OBMol.SetData()

2012-09-17 Thread Noel O'Boyle
Use CloneData instead of SetData. On 17 September 2012 15:16, Jon Fuller wrote: > Dear All, > > I had a question about the use of OBMol.SetData() through the Java > bindings. I would expect to be able to do something like this: > > OBCommentData comment = new OBCommentData() > comment.SetData("Th

[Open Babel] Java bindings: OBMol.SetData()

2012-09-17 Thread Jon Fuller
Dear All, I had a question about the use of OBMol.SetData() through the Java bindings. I would expect to be able to do something like this: OBCommentData comment = new OBCommentData() comment.SetData("This is a comment"); comment.SetAttribute("cmt"); mol.SetData(comment); Then to read back somet