Command Reference

Command Reference

Atom Commands

Define and set properties of atoms.

[Note]See also:

atomstyle

Syntax:

void atomstyle(string  style);

Sets the individual drawing style for the current atom selection, used when the global drawing style is 'individual'.

For example:

atomstyle("tube")

sets the current atom selection to be drawn in the 'tube' style.

[Note]See also:

currentatom

Syntax:

atom currentatom(); 
atom currentatom(id); 
atom|id  id;

Return a reference to the current atom. If a new atom/id is provided the current atom is set before being returned.

For example:

atom i = getatom(1);

makes the first atom in the current model the current atom, and returns a reference to it.

fix

Syntax:

void fix(id = 0); 
atom|id  id = 0;

Fix the positions of the current atom selection (or individual atom specified) so that they remain in the same position following various methods (e.g. minimisations).

For example:

fix();

fixes the positions of all selected atoms.

for (int n=1; n<=10; ++n) fix(n);

fixes the positions of the first 10 atoms in the current model.

free

Syntax:

void free(id = 0); 
atom|id  id = 0;

Free the positions of previously fixed atoms in the current selection (or the individual atom specified).

For example:

free(5);

allows the fifth atom in the current model to be moved again.

getatom

Syntax:

atom getatom(id); 
atom|id  id;

Return a reference to the atom specified.

For example:

atom i = getatom(3);

returns a reference to the third atom in the current model.

hide

Syntax:

void hide(id = 0); 
atom|id  id = 0;

Hides the current selection of atoms (or the supplied atom) from view, meaning they cannot be selected by direct clicking/highlighting in the GUI. They are still subject to transformation if they are selected by other means.

setcharge

Syntax:

void setcharge(q); 
double  q;
void setcharge(q,  
 id); 
double  q;
int  id;

Set the atomic charge of the current (or specified) atom.

setcoords

Syntax:

void setcoords(x,  
 y,  
 z); 
double  x;
double  y;
double  z;
void setcoords(x,  
 y,  
 z,  
 id); 
double  x;
double  y;
double  z;
int  id;

Set the coordinates of the current (or specified) atom.

setelement

Syntax:

void setelement(element); 
string|int  element;
void setelement(element,  
 id); 
string|int  element;
int  id;

Set the element of the current (or specified) atom.

setforces

Syntax:

void setforces(fx,  
 fy,  
 fz); 
double  fx;
double  fy;
double  fz;
void setforces(fx,  
 fy,  
 fz,  
 id); 
double  fx;
double  fy;
double  fz;
int  id;

Set the forces of the current (or specified) atom.

setfx

Syntax:

void setfx(d); 
double  d;
void setfx(d,  
 id); 
double  d;
int  id;

Set the x force of the current (or specified) atom.

setfy

Syntax:

void setfy(d); 
double  d;
void setfy(d,  
 id); 
double  d;
int  id;

Set the y force of the current (or specified) atom.

setfz

Syntax:

void setfz(d); 
double  d;
void setfz(d,  
 id); 
double  d;
int  id;

Set the z force of the current (or specified) atom.

setid

Syntax:

void setid(newid); 
int  newid;
void setid(newid,  
 id); 
int  newid;
int  id;

Set the temporary ID of the current (or specified) atom, useful for when parsing atoms from a file that are not in any useful order but have an id specified for the purposes of subsequent connectivity definitions, for example. Within filters, once loading is complete the finalisemodel command will reset all atom ids to internal numbering.

setrx

Syntax:

void setrx(d); 
double  d;
void setrx(d,  
 id); 
double  d;
int  id;

Set the x coordinate of the current (or specified) atom.

setry

Syntax:

void setry(d); 
double  d;
void setry(d,  
 id); 
double  d;
int  id;

Set the y coordinate of the current (or specified) atom.

setrz

Syntax:

void setrz(d); 
double  d;
void setrz(d,  
 id); 
double  d;
int  id;

Set the z coordinate of the current (or specified) atom.

setvelocities

Syntax:

void setvelocities(vx,  
 vy,  
 vz); 
double  vx;
double  vy;
double  vz;
void setvelocities(vx,  
 vy,  
 vz,  
 id); 
double  vx;
double  vy;
double  vz;
int  id;

Set the velocity components of the current (or specified) atom.

setvx

Syntax:

void setvx(d); 
double  d;
void setvx(d,  
 id); 
double  d;
int  id;

Set the x velocity of the current (or specified) atom.

setvy

Syntax:

void setvy(d); 
double  d;
void setvy(d,  
 id); 
double  d;
int  id;

Set the y velocity of the current (or specified) atom.

setvz

Syntax:

void setvz(d); 
double  d;
void setvz(d,  
 id); 
double  d;
int  id;

Set the z velocity of the current (or specified) atom.

show

Syntax:

void show(id = 0); 
atom|int  id = 0;

Makes the current selection of atoms (or the supplied atom) visible again if they were previously hidden.