VMD-L Mailing List
From: Elif Ozkirimli (ozkiriml_at_seger.bio.purdue.edu)
Date: Wed May 26 2004 - 13:32:28 CDT
- Next message: Axel Kohlmeyer: "Re: animating an iso-surface"
- Previous message: Ahmet Bakan: "Torsional Angles"
- In reply to: Jim Phillips: "Re: changing the representation of all loaded molecules"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Thanks Jim, this works great!
Elif
On Thu, 20 May 2004, Jim Phillips wrote:
> Hi all,
>
> On Wed, 19 May 2004, Elif Ozkirimli wrote:
>
> > I was wondering if there was a way to copy the representations I create
> > for one molecule to the others.
>
> Here's a script I wrote a couple of weeks ago to do exactly this, based on
> the current save-state code in VMD. Source this file and then use the
> clone_reps command to make all molecules the same representations as the
> current "top" molecule.
>
> -Jim
>
>
> #
> # Save all representations and their complete settings
> #
> # XXX this code is not saving the state of the 6
> # per-rep user-defined clipping planes yet.
> proc clone_reps {} {
> set srcmol [molinfo top]
> foreach mol [molinfo list] {
> if {$mol == $srcmol} continue
> #delete current representations
> set numreps [molinfo $mol get numreps]
> for {set i 0} {$i < $numreps} {incr i} {
> mol delrep 0 $mol
> }
> }
> for {set i 0} {$i < [molinfo $srcmol get numreps]} {incr i} {
> set rep [molinfo $srcmol get "{rep $i} {selection $i} {color $i} {material $i}"]
> lappend rep [mol showperiodic $srcmol $i]
> lappend rep [mol numperiodic $srcmol $i]
> lappend rep [mol showrep $srcmol $i]
> lappend rep [mol selupdate $i $srcmol]
> lappend rep [mol colupdate $i $srcmol]
> lappend rep [mol scaleminmax $srcmol $i]
> lappend rep [mol smoothrep $srcmol $i]
> lappend rep [mol drawframes $srcmol $i]
> foreach mol [molinfo list] {
> if {$mol == $srcmol} continue
> foreach {r s c m pbc numpbc on selupd colupd colminmax smooth framespec} $rep { break }
> eval "mol representation $r"
> eval "mol color $c"
> eval "mol selection {$s}"
> eval "mol material $m"
> eval "mol addrep $mol"
> if {[string length $pbc]} {
> eval "mol showperiodic $mol $i $pbc"
> eval "mol numperiodic $mol $i $numpbc"
> }
> eval "mol selupdate $i $mol $selupd"
> eval "mol colupdate $i $mol $colupd"
> eval "mol scaleminmax $mol $i $colminmax"
> eval "mol smoothrep $mol $i $smooth"
> eval "mol drawframes $mol $i {$framespec}"
> if { !$on } {
> eval "mol showrep $mol $i 0"
> }
> }
> }
> }
>
>
>
>
______________
Elif Ozkirimli
Graduate Research Assistant
Purdue University
Phone: (765)494-9836
- Next message: Axel Kohlmeyer: "Re: animating an iso-surface"
- Previous message: Ahmet Bakan: "Torsional Angles"
- In reply to: Jim Phillips: "Re: changing the representation of all loaded molecules"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]