Skip to content
Sections
Personal tools
You are here: Home » BALLView » Support » PythonScripts » Scripts » Select.py

Select.py

Document Actions
Select all atoms in proximity of less than maxdistance from a selected atom.
maxdistance = 4

system = getComposites()[0]

cl = []

for atom1 in atoms(system):
  if not atom1.isSelected():
    continue
  for atom2 in atoms(system):
    dist = (atom1.getPosition() - atom2.getPosition()).getLength()
    if not atom2.isSelected() and dist < maxdistance:
      cl.append(atom2)

system.deselect()

for atom in cl:
  atom.select()

getMainControl().update(system)
 
 

Powered by Plone

This site conforms to the following standards: