Hi Pablo,
If you want to rename a model programmatically, you just set it’s “name” attribute, e.g.:

m.name = “new name”

If you don’t have a Python reference to the model but know it’s model ID number, you could use the “setattr” command, e.g.:

from chimera import runCommand
runCommand(“setattr m name ‘new name’ #2”)

If you need to fetch the name from the user, then you will have to put up some kind of dialog for that, similar to what renameDialog.py does.

—Eric

Eric Pettersen
UCSF Computer Graphics Lab


On Apr 12, 2018, at 7:15 AM, Pablo Solar Rodríguez <pablosolar.r@gmail.com> wrote:

Hello all!

I am introducing some features in my plugin and I would like to know if there is any smart of way to rename a PDB that is loaded in the Model Panel.

I've seen the renameDialog.py module in ModelPanel package but didn't see any way to call it from my plugin.

Thank you in advance and kind regards!


_______________________________________________
Chimera-dev mailing list
Chimera-dev@cgl.ucsf.edu
http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev