- 1.7
- 1.6
- 1.5
- Beta
- Examples (for 1.6a)
- Misc
Select atoms or groups of atoms within the current model.
Syntax:
int deselect( | selection, | |
...); |
atom|int|string | selection; |
| ...; |
Deselect atoms in the current model, returning the number of atoms deselected by the provided selection arguments. One or more arguments may be supplied, and each may be of the type int, atom, or string. In the case of the first two types, individual atoms (or those corresponding to the integer id) are deselected. On the other hand, strings may contain ranges of atom IDs and element symbols permitting atoms to be deselected in groups. Ranges are specified as 'a-b' where a and b are either both atom IDs or both element symbols. In addition, the '+' symbol can be used before ('+a') or after ('a+') an atom ID or element symbol to mean either 'everything up to and including this' or 'this and everything after'. Within a string argument, one or more selection ranges may be separated by commas.
For example:
deselect(5);
deselects the 5th atom.
deselect("1-10,N");deselects the first ten atoms, and all nitrogen atoms.
int n = deselect("Sc-Zn");deselects the first transition series of elements, returning the number of atoms that were deselected in the process.
deselect("C+");deselects all elements carbon and above.
deselect(1, 2, 5, "8+");
deselects the first, second, and fifth atoms, as well as the eighth atom and all that occur after it.
Syntax:
int expand( | ); |
Expand the current selection of atoms by selecting any atoms that are directly bound to an already-selected atom. The number of atoms added to the previous selection is returned.
For example:
expand();
Syntax:
int invert( | ); |
Inverts the selection of all atoms in the current model. Returns the number of atoms selected.
For example:
invert();
Syntax:
int select( | selection, | |
...); |
atom|int|string | selection; |
| ...; |
Select atoms in the current model, keeping any previous selection of atoms. See the deselect command for a full description of the syntax. The number of atoms added to the existing selection is returned.
For example:
select("+5");selects the first five atoms.
int n = select("+5,H");selects the first five atoms and all hydrogens.
Syntax:
int selectall( | ); |
Select all atoms in the current model. The number of selected atoms is returned.
For example:
selectall();
Syntax:
int selectfftype( | fftype); |
string | fftype; |
Select all atoms with forcefield type fftype in the current model. The number of atoms selected is returned.
For example:
selecttype("CT");selects all atoms that have been assigned the forcefield type 'CT'.
Syntax:
int selectmiller( | h, | |
| k, | ||
| l, | ||
inside = FALSE); |
int | h; |
int | k; |
int | l; |
int | inside = FALSE; |
Select all atoms that are 'outside' the specified Miller plane (and its mirror, if it has one). If the final parameter is specified as TRUE then atoms inside the specified Miller plane (and its mirror) are selected.
For example:
selectmiller(1, 1, 1);
selects all atoms located beyond the (111) plane in the unit cell.
Syntax:
int selectoverlaps( | dist = 0.2); |
double | dist = 0.2; |
Select all atoms that are within a certain distance of another, or the default of 0.2 Å if no argument is provided. The number of selected overlapping atoms is returned.
For example:
int noverlaps = selectoverlaps("0.1");selects all atoms that are less than 0.1 Å away from another.
Syntax:
int selectpattern( | id, | |
| name, | ||
p); |
int | id; |
string | name; |
pattern | p; |
Selects all atoms in the current (or named/specified) pattern. Returns the number of atoms added to the existing selection.
For example:
selectpattern(2);
select all atoms in the second pattern of the current model.
selectpattern("bubble");select all atoms in the pattern 'bubble' of the current model.
Syntax:
int selectradial( | id, | |
r); |
atom|int | id; |
double | r; |
Select all atoms within r Å of the supplied target atom (which is also selected). Returns the number of atoms added to the existing selection.
For example:
int nclose = selectradial(10, 4.5);
selects all atoms within 4.5 Å of atom 10, and returns the number selected.
Syntax:
int selecttype( | element, | |
neta); |
int|string | element; |
string | neta; |
Selects all atoms of the given element that also match the NETA description given, allowing selections to be made based on the connectivity and local environment of atoms. The number of (previously unselected) atoms matched is returned.
For example:
int nch2 = selecttype("C", "-H(n=2)");selects all carbon atoms that are bound to two hydrogens.
![]() | See also: |
|---|---|
|


![[Note]](images/note.png)