Hi Pedro,

chempy.Atom doesn't store model and state. The only option I can think of right 
now is to use a custom property (Incentive PyMOL feature, won't work in 
Open-Source PyMOL):

    cmd.alter('all', 'p.model = model')
    print(cmd.get_model('all').atom[0].atom_properties['model'])

Or maybe you can do the same thing with cmd.iterate_state, consider the 
following two approaches to the same problem:

# using get_model
for state in range(1, cmd.count_states() + 1):
    for at in cmd.get_model("all", state):
        print(at.coord)
        print(at.text_type)
        print(at.atom_properties['model'])
        print(state)

# using iterate or iterate_state
def callback(x, y, z, text_type, model, state):
    print((x, y, z))
    print(text_type)
    print(model)
    print(state)
cmd.iterate_state(0, "all", "callback(x,y,z,text_type,model,state)",
  space={"callback": callback})


Hope that helps.

Cheers,
  Thomas


> On Nov 6, 2020, at 6:29 PM, Pedro Lacerda <pslace...@gmail.com> wrote:
> 
> Hi,
> 
> I got an `chempy.Atom` instance via `cmd.get_model().atom`.
> 
> How to get the state and object name.
> 
> 
> Thank you!
> 
> -- 
> Pedro Sousa Lacerda
> 
> Laboratório de Bioinformática e Modelagem Molecular / UFBA
> Mestrando em Ciências Farmácias / UEFS
> 
> @pslacerda
> +55 71 9 9981-1856
> http://lattes.cnpq.br/8338596525330907
> _______________________________________________
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe: 
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.



_______________________________________________
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Reply via email to