CalcArea

From PyMOLWiki
Revision as of 09:52, 20 March 2009 by Inchoate (talk | contribs) (New page: =Overview= This code will calculate the area of a given selection. If you have a bunch of disparate selections, or one selection made up of various objects then you can use this to find t...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

This code will calculate the area of a given selection. If you have a bunch of disparate selections, or one selection made up of various objects then you can use this to find the area.

The Code

def calcArea(sel):
	"""
	Calculate the area of an object or selection (as if it were one complete object).
	"""
	cmd.flag("ignore", "none")
	cmd.set("dot_density", 3)
	tName = "__temp__for__doArea__"
	cmd.create(tName, sel)
	theArea = cmd.get_area(tName)
	cmd.delete(tName)
	return theArea

See Also