Menu

#988 OBMol.GetCoordinates() do not work.

2.4.x
open
1
2016-12-15
2016-12-09
No

Dear Dev,

OBMol.GetCoordinates returns a C array and it is not accesseble from Python.
( <Swig Object="" of="" type="" 'double="" *'="" at="" 0x10d487f90=""> )

Best Regards,
Fabio L.

Discussion

  • Noel O'Boyle

    Noel O'Boyle - 2016-12-15

    This is correct, but as the coordinates are accessible via OBAtom.GetVector(), I don't plan to implement access to this.

     
  • Fabio Lolicato

    Fabio Lolicato - 2016-12-15

    It is making sense. Thanks for prompt reply.
    Just for completeness , also OBAtom.GetVector() seems doesn't work :
    <openbabel.vector3; proxy="" of="" <Swig="" Object="" of="" type="" 'OpenBabel::vector3="" *'="" at="" 0x114085480=""> >

    On the other hand, is true that, the coordinates are accessible via OBAtom.GetX(),OBAtom.GetY(),OBAtom.GetZ().

     
  • Noel O'Boyle

    Noel O'Boyle - 2016-12-15

    Good point, GetX(), etc. is probably the best way. GetVector() is working, but if you look at the OB API, you need to call GetX(), etc. on that to actually get the values.