SAMSON Forum
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • SAMSON Connect
    • Get SAMSON

    Get the atom xyz file coordinates

    Modeling
    2
    5
    3255
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Laëtitia
      Laëtitia last edited by

      Hello,

      When a xyz is imported, are the coordinates of the atoms saved somewhere? I don't find the proper element in SBAtom, getX is not the one...

      Thanks

      Laëtitia

      1 Reply Last reply Reply Quote 0
      • DmitriyMarin
        DmitriyMarin last edited by

        Dear @Laëtitia ,

        Yes, they are saved as well as other properties of an atom and you can access them as follows (see e.g. documentation on SBMStructuralModelNodeParticle class - a parent class to the SBAtom class):

        SBAtom* atom = new SBAtom(element, SBQuantity::angstrom(x), SBQuantity::angstrom(y), SBQuantity::angstrom(z));
        SBQuantity::length x = atom->getX();
        SBPosition3 pos = atom->getPosition();
        

        Dmitriy,
        The SAMSON Team, https://s-c.io

        1 Reply Last reply Reply Quote 1
        • Laëtitia
          Laëtitia last edited by

          Tnaks for your answer.

          I indeed used the getX, getY, getZ functions but somehow I have completly different value that in my xyz. I'll dig in ASAP.

          1 Reply Last reply Reply Quote 0
          • DmitriyMarin
            DmitriyMarin last edited by

            If they differ by some order of magnitude, then it might be due to use of different quantities. e.g. SBQuantity::length (which is SBQuantity::picometer) or SBQuantity::angstrom.

            Dmitriy,
            The SAMSON Team, https://s-c.io

            1 Reply Last reply Reply Quote 1
            • Laëtitia
              Laëtitia last edited by

              oh you're right there is a 100 coefficient, it's giving me the coordinate in pm. Didn't think about that.
              thank you very much.

              1 Reply Last reply Reply Quote 1
              • First post
                Last post