Thanks a lot Tsjerk for your help.
I am using MacPymol 0.99rc6 . Both versions of the solution you presented
worked. The only thing I had to do was to run on the command line prompt
inside pymol.
from pymol.cgo import *
Then I could run either version you suggested to get the axes to show up
( with the obj still in the file)
execfile("/Users/hari/Desktop/test.cgo")
cmd.load_cgo(obj,"test")
OR ( with the obj = removed)
cmd.load_cgo( eval( open("/Users/hari/Desktop/test.cgo").read() ), "test" )
Thanks
Hari
On Fri, Feb 22, 2008 at 4:07 AM, Tsjerk Wassenaar <[email protected]> wrote:
> Hi Hari,
>
> You can do it using:
>
> execfile("/Users/hari/Desktop/test.cgo")
> cmd.load_cgo(obj,"test")
>
> However, you might find it more convenient to drop the "obj =" from
> the .cgo file and load the thing with:
>
> cmd.load_cgo( eval( open("/Users/hari/Desktop/test.cgo").read() ), "test"
> )
>
> Although that seems a bit more complicated, it's in fact quite easy to
> define as a function itself. Hmm, I think I'm gonna store my CGO
> objects just like that myself :)
>
> Hope it helps,
>
> Tsjerk
>
>
> On Thu, Feb 21, 2008 at 10:16 PM, hari jayaram <[email protected]> wrote:
> > Hi I have a running pymol session with nothing loaded.
> > I now want to load a cgo object into this session.
> > When I read in the cgo file using either command line (load
> > /Users/hari/Desktop/test.cgo , test ) or the GUI menu , I get an object
> > entry on the side panel but nothing shows up in the viewing window.
> >
> > I can successfully load any cgo file using a python script . I want to
> > learn how to "inject" a cgo object like the one given below into a
> running
> > python session .
> > Can someone tell me how to do this.
> >
> > Your help is greatly appreciated
> > Thank You
> > Hari Jayaram
> > Brandeis University
> >
> > #Contents of test.cgo file
> >
> > obj = [
> >
> > BEGIN, LINES,
> >
> > COLOR, 1.0, 1.0, 1.0,
> >
> >
> >
> >
> > VERTEX, 0.0, 0.0, 0.0,
> >
> > VERTEX, 1.0, 0.0, 0.0,
> >
> >
> >
> >
> > VERTEX, 0.0, 0.0, 0.0,
> >
> > VERTEX, 0.0, 2.0, 0.0,
> >
> >
> >
> >
> > VERTEX, 0.0, 0.0, 0.0,
> >
> > VERTEX, 00, 0.0, 3.0,
> >
> >
> >
> >
> > END]
> >
> -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > PyMOL-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/pymol-users
> >
> >
>
>
>
> --
> Tsjerk A. Wassenaar, Ph.D.
> Junior UD (post-doc)
> Biomolecular NMR, Bijvoet Center
> Utrecht University
> Padualaan 8
> 3584 CH Utrecht
> The Netherlands
> P: +31-30-2539931
> F: +31-30-2537623
>