Skip to content
  • Recent
  • Tags
  • Popular
  • SAMSON Connect
  • Get SAMSON
Collapse
SAMSON Forum
  1. Home
  2. Develop
  3. Modeling
  4. Get the atom xyz file coordinates

Get the atom xyz file coordinates

Scheduled Pinned Locked Moved Modeling
5 Posts 2 Posters 4.9k Views 1 Watching
  • 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ëtitiaL
    LaëtitiaL
    Laëtitia
    wrote on last edited by
    #1

    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
    0
    • DmitriyMarinD
      DmitriyMarinD
      DmitriyMarin
      wrote on last edited by
      #2

      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
      1
      • LaëtitiaL
        LaëtitiaL
        Laëtitia
        wrote on last edited by
        #3

        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
        0
        • DmitriyMarinD
          DmitriyMarinD
          DmitriyMarin
          wrote on last edited by
          #4

          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
          1
          • LaëtitiaL
            LaëtitiaL
            Laëtitia
            wrote on last edited by
            #5

            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
            1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Recent
            • Tags
            • Popular
            • SAMSON Connect
            • Get SAMSON