[Chimera-users] modeldisp

Eric Pettersen pett at cgl.ucsf.edu
Mon Jun 29 17:48:58 PDT 2009

Hi Chris,
	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...

	models = chimera.openModels.open("myfile.mol2")
	for i in range(len(models)):

though perhaps more direct would be:

	models = chimera.openModels.open("myfile.mol2")
	for m in models: m.display = False
	for i, m in enumerate(models):
		... setup stuff
		m.display = True
		... more stuff
		m.display = False


                         Eric Pettersen
                         UCSF Computer Graphics Lab

On Jun 29, 2009, at 5:11 PM, cdlau at ucsd.edu wrote:

> Hi,
> I am currently using the modeldisp command on the command line to  
> hide and
> view various molecules within a single mol2 file.  I was wondering  
> how I
> would be able to access how many total molecules there were in a  
> single
> mol2 file.  For example, if the mol2 file is loaded into model 0, I  
> would
> be using
> modeldisp #0.$i
> etc in a large loop where $i is changing.  What command can I use to
> return a value for the total number of molecules in the mol2 file so  
> I can
> have this be the upper limit of $i?
> Thanks for your help,
> Chris
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20090629/e9f9aece/attachment.html>

More information about the Chimera-users mailing list