The ray command bugs me, so I'll take a stab at improving it this afternoon.

Can someone tell me how to get the size of the current viewport?

This solution:
width,height = cmd.get_session()['main'][0:2]

doesn't seem to work for me:

PyMOL>print sorted(cmd.get_session().keys())
['cache', 'color_ext', 'colors', 'editor', 'movie', 'names', 'scene_dict', 'scene_order', 'selector_secrets', 'session', 'settings', 'unique_settings', 'version', 'view', 'view_dict', 'wizard']


On Wed, Jan 20, 2010 at 3:54 PM, Tsjerk Wassenaar <> wrote:

> ray 10cm, 20cm, dpi=300?
> ray 2.5in, 5in, dpi=300?

I'd slightly modify that to read:

ray 10,10,units=cm,resolution=300

where units can be pixels (default), cm, inches, meters, yards, lightyears...



Tsjerk A. Wassenaar, Ph.D.

Computational Chemist
Medicinal Chemist

Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
PyMOL-users mailing list (
Info Page:

Michael Lerner, Ph.D.
IRTA Postdoctoral Fellow
Laboratory of Computational Biology NIH/NHLBI
5635 Fishers Lane, Room T909, MSC 9314
Rockville, MD 20852 (UPS/FedEx/Reality)
Bethesda MD 20892-9314 (USPS)