This works well for what I need. I don't know how I missed the group command.

Thanks!

On Dec 17, 2010, at 2:02 PM, Jason Vertrees wrote:

> Hi Jason,
> 
> Unfortunately that capability isn't yet present in PyMOL.  Improved
> state handling is something we're working on and have prioritized.
> 
> As a workaround, consider loading the object with the multiplex flag
> set, then when the user makes the selection you can record the object
> name and determine the state number from there.  You can use the group
> object to not pollute the object menu/namespace.  For example:
> 
> # models are loaded as: "name_001", "name_002", etc.
> # so we will split on the "_" and return the state number
> from string import split
> 
> # used to get data from iterate/alter commands
> from pymol import stored
> stored.name = ""
> 
> # fetch a multi-state object
> fetch 1nmr, multiplex=1
> 
> # put all these states into a group; keeps things cleaner
> group 1nmr, 1nmr*
> 
> #
> # -- Now, select an atom with the mouse, so "sele" is created
> #
> iterate first sele, stored.name = model
> 
> print "User selected model %d" % int(split(stored.name, "_")[1])
> 
> 
> This is not ideal, but should get you closer to your solution.
> 
> Cheers,
> 
> -- Jason
> 
> 
> 
> 
> On Fri, Dec 17, 2010 at 10:23 AM, Jason Ferrara <[email protected]> wrote:
>> If I have a multi state object loaded, and all_states set to on, is there a 
>> way to select individual states with the mouse? Or if not at least some way 
>> to query which state was clicked in to generate the selection, or to query 
>> which state lies under a given x,y position in the view?
>> 
>> I'm writing a plugin where I need to have the user select a state from a 
>> multi state model.
>> 
>> Thanks
>> 
>> - J
>> ------------------------------------------------------------------------------
>> Lotusphere 2011
>> Register now for Lotusphere 2011 and learn how
>> to connect the dots, take your collaborative environment
>> to the next level, and enter the era of Social Business.
>> http://p.sf.net/sfu/lotusphere-d2d
>> _______________________________________________
>> PyMOL-users mailing list ([email protected])
>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
>> Archives: http://www.mail-archive.com/[email protected]
>> 
> 
> 
> 
> -- 
> Jason Vertrees, PhD
> PyMOL Product Manager
> Schrodinger, LLC
> 
> (e) [email protected]
> (o) +1 (603) 374-7120


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your 
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
PyMOL-users mailing list ([email protected])
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/[email protected]

Reply via email to