Dear Mike, You can at least do the following:
*** first call of command *** - parse the file - store the data in an object (dictionary, list, etc.) - you can probably store the Strings that make up the CGO object. - refine the data using the cutoff - create CGO object from refined data *** second call of command *** - delete CGO object - refine the data using the cutoff - create CGO object from refined data Message: You can create objects in Python scripts that are persistent as long as PyMOL is running. This should work a lot faster than parsing the file several times. Kristian > What I want to do is parse a file that has a bunch of coordinates and draw > the spheres in PyMOL. But then I want to be able to adjust the cutoff for > which points are to be drawn. > > What I was doing now was first to run the script to bind the function to a > command. Then the function will load the file and draw the spheres at a > particular cutoff. If I rerun the function, it will delete the old CGO > object, parse the file again, and recreate a new CGO. But if the file is > really big, this becomes cumbersome. > > Or maybe what I need to do is create a "pymol object" and then have it > create the CGO object everytime it needs to be drawn. Then have my > function be able to update the cutoff parameter for the object. > > Thanks! > Mike >