<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi Randy,<DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>I've also gone ahead and improved the polymorphism of those Midas functions, so what you did originally will work starting with the next snapshot release.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--Eric</DIV><DIV><BR><DIV><DIV>On Feb 12, 2007, at 1:39 PM, Eric Pettersen wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">Hi Randy,<DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>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:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "> self.model = ReadSDF.readSDF(tmpfile.name)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "> chimera.openModels.add(self.model)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR style=""></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "> from chimera.selection import ItemizedSelection</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "> sel = ItemizedSelection()</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "> sel.add(self.model)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "> Midas.represent('cpk', sel)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">--Eric</DIV><DIV><BR><DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="5" style="font: 16.0px Helvetica"><SPAN class="Apple-converted-space"> </SPAN>Eric Pettersen</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="5" style="font: 16.0px Helvetica"><SPAN class="Apple-converted-space"> </SPAN>UCSF Computer Graphics Lab</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="5" style="font: 16.0px Helvetica"><SPAN class="Apple-converted-space"> </SPAN><A href="mailto:pett@cgl.ucsf.edu">pett@cgl.ucsf.edu</A></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 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></DIV> <BR class="Apple-interchange-newline"> </DIV><BR><DIV><DIV>On Feb 12, 2007, at 12:28 PM, Randy Heiland wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I'd like to be able to set the representation (wire, stick, bs, cpk) of</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">a model programmatically, in this case, from a plugin.<SPAN class="Apple-converted-space"> </SPAN>I was trying the</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">following, but the newly displayed model would always be displayed in</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">wire:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space"> </SPAN>self.model = ReadSDF.readSDF(tmpfile.name)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space"> </SPAN>chimera.openModels.add(self.model)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space"> </SPAN>#Midas.represent('stick', self.model)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space"> </SPAN>Midas.represent('cpk', self.model)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Suggestions?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">thanks, Randy</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Chimera-users mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users">http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users</A></DIV> </BLOCKQUOTE></DIV><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Chimera-users mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users">http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>