<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Pablo,<div class=""><span class="Apple-tab-span" style="white-space:pre">       </span>If you want to rename a model programmatically, you just set it’s “name” attribute, e.g.:</div><div class=""><br class=""></div><div class="">m.name = “new name”</div><div class=""><br class=""></div><div class="">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.:</div><div class=""><br class=""></div><div class="">from chimera import runCommand</div><div class="">runCommand(“setattr m name ‘new name’ #2”)</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">—Eric</div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><span class="Apple-tab-span" style="white-space: pre;">    </span>Eric Pettersen</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">  </span>UCSF Computer Graphics Lab</div></div><br class="Apple-interchange-newline">

</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Apr 12, 2018, at 7:15 AM, Pablo Solar Rodríguez <<a href="mailto:pablosolar.r@gmail.com" class="">pablosolar.r@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">Hello all!</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><br class=""></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">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.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><br class=""></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">I've seen the renameDialog.py module in ModelPanel package but didn't see any way to call it from my plugin.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><br class=""></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">Thank you in advance and kind regards!</div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><p class=""><br class=""></p></div></div></div></div></div></div>
</div>
_______________________________________________<br class="">Chimera-dev mailing list<br class=""><a href="mailto:Chimera-dev@cgl.ucsf.edu" class="">Chimera-dev@cgl.ucsf.edu</a><br class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev<br class=""></div></blockquote></div><br class=""></div></body></html>