<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Chris,<div><span class="Apple-tab-span" style="white-space:pre"> </span>I don't know how you opened your file, but if you opened it with chimera.openModels.open() then the return value is a list of models from that file, so...</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>models = chimera.openModels.open("myfile.mol2")</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>for i in range(len(models)):</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>...</div><div><br></div><div>though perhaps more direct would be:</div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>models = chimera.openModels.open("myfile.mol2")</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>for m in models: m.display = False</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>for i, m in enumerate(models):</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>... setup stuff</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>m.display = True</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>... more stuff</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>m.display = False</div><div><br></div><div>--Eric</div><div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>Eric Pettersen</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>UCSF Computer Graphics Lab</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> </span><a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></p><br class="Apple-interchange-newline"></div></span> </div><br><div><div>On Jun 29, 2009, at 5:11 PM, <a href="mailto:cdlau@ucsd.edu">cdlau@ucsd.edu</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br><br>I am currently using the modeldisp command on the command line to hide and<br>view various molecules within a single mol2 file. I was wondering how I<br>would be able to access how many total molecules there were in a single<br>mol2 file. For example, if the mol2 file is loaded into model 0, I would<br>be using<br><br>modeldisp #0.$i<br><br>etc in a large loop where $i is changing. What command can I use to<br>return a value for the total number of molecules in the mol2 file so I can<br>have this be the upper limit of $i?<br><br>Thanks for your help,<br><br>Chris<br>_______________________________________________<br>Chimera-users mailing list<br><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a><br>http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users<br></div></blockquote></div><br></div></body></html>