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:
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
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