programmatic representation

I'd like to be able to set the representation (wire, stick, bs, cpk) of a model programmatically, in this case, from a plugin. I was trying the following, but the newly displayed model would always be displayed in wire: self.model = ReadSDF.readSDF(tmpfile.name) chimera.openModels.add(self.model) #Midas.represent('stick', self.model) Midas.represent('cpk', self.model) Suggestions? thanks, Randy

Hi Randy, The second argument to Midas.represent() is polymorphic, and if it is a list then is is expected to be a list of atoms. You're giving it a list of models, which results in the 'drawMode' attribute of those models being set (to no effect). Perhaps the polymorphism of the second argument could be improved to handle lists of models (or residues), but right now it doesn't. My suggestion is to use a Selection object based on your list of models, which Midas.represent () can handle, perhaps like so: self.model = ReadSDF.readSDF(tmpfile.name) chimera.openModels.add(self.model) from chimera.selection import ItemizedSelection sel = ItemizedSelection() sel.add(self.model) Midas.represent('cpk', sel) --Eric Eric Pettersen UCSF Computer Graphics Lab pett@cgl.ucsf.edu http://www.cgl.ucsf.edu On Feb 12, 2007, at 12:28 PM, Randy Heiland wrote:
I'd like to be able to set the representation (wire, stick, bs, cpk) of a model programmatically, in this case, from a plugin. I was trying the following, but the newly displayed model would always be displayed in wire:
self.model = ReadSDF.readSDF(tmpfile.name) chimera.openModels.add(self.model)
#Midas.represent('stick', self.model) Midas.represent('cpk', self.model)
Suggestions? thanks, Randy
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (2)
-
Eric Pettersen
-
Randy Heiland