User 870ab5b546
11-01-2011 19:16:54
I want to find which H atoms in a Molecule are D or T atoms. I tried using getMassno() on all atoms with getAtno() == 1, but getMassno() always returns 0, even when I drew a D atom in the initial structure before importing it. It seems to me that when the isotope is specified, getMassno() should return a positive value, not 0.
I can get the value I need with Math.round(getMass()), but getMassno() should give me what I want.
ChemAxon 25dcd765a3
12-01-2011 14:24:33
Hi Bob,
It works for me.
Here is the code
Molecule mol = MolImporter.importMol("[2H]");
System.out.println(mol.getAtom(0).getMass());
mol = MolImporter.importMol("[3H]");
System.out.println(mol.getAtom(0).getMass());
The output is:
marvin/trunk> java Test
2.014101778
3.016049268
So if getMass() != 0 then you have isotope.
User 870ab5b546
12-01-2011 18:54:40
Never mind, it seems to be working now, I must have done something wrong before. You may delete this whole thread.
ChemAxon 25dcd765a3
13-01-2011 14:54:49
Hi,
getMassno() also works for me:
Molecule mol = MolImporter.importMol("[2H]");
System.out.println(mol.getAtom(0).getMassno());
mol = MolImporter.importMol("[3H]");
System.out.println(mol.getAtom(0).getMassno());
The output:
marvin/trunk> java Test
2
3