[chimera-dev] Renaming a PDB loaded the Model Panel
Eric Pettersen
pett at cgl.ucsf.edu
Thu Apr 12 10:44:04 PDT 2018
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 at 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 at cgl.ucsf.edu
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20180412/0e5bed67/attachment.html>
More information about the Chimera-dev
mailing list