<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 9, 2015, at 1:34 PM, Dougherty, Matthew T <<a href="mailto:matthewd@bcm.edu" class="">matthewd@bcm.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="divtagdefaultwrapper" style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 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; font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class="">I would like to print out the model ID, name and input files as they are listed in the model panel.</div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">Can you point me in the direction of how to loop over the model panel ?</div><div style="margin-top: 0px; margin-bottom: 0px;" class="">Such as elevant variables, and what would be a block of code in chimera that I should study. </div></div></div></blockquote><br class=""></div><div>Hi Matt,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>I don’t know that you need to go through the Model Panel per se, you could just go through Chimera’s open models list:</div><div><br class=""></div><div>chimera.openModels.list()</div><div><br class=""></div><div><br class=""></div><div>Each model in the list has:</div><div><br class=""></div><div>id<span class="Apple-tab-span" style="white-space:pre"> </span>ID number</div><div>subid<span class="Apple-tab-span" style="white-space:pre"> </span>Sub-ID number (None if it doesn’t have a sub-ID)</div><div>name<span class="Apple-tab-span" style="white-space:pre"> </span>Name</div><div>openedAs<span class="Apple-tab-span" style="white-space:pre"> </span>If it came from a file, a 4-tuple of stuff you mostly don’t care about, but the first element is the file name</div><div><br class=""></div><div>Since some models don’t come from files (e.g. on-the-fly VRML models), you may want to use the model panel’s “inputPath” function to always get a usable/readable string:</div><div><br class=""></div><div>from ModelPanel import inputPath</div><div>path = inputPath(model)</div><div><br class=""></div><div>—Eric</div><br class=""><div class=""><div class=""><div style="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 class=""><br class=""></div></div></div></div></body></html>