Keywords: viewmol

## 7.2 Adding or replacing atoms

From the main window menu select the `Modify molecule` entry in the `Molecule` submenu. The dialog box shown in the Figure is displayed. The upper part contains the periodic table of elements and allows the selection of the element to be added or used as replacement.

In the middle there are a number of buttons for selecting different operations and certain defaults. These are the following:

- Change geometry
  If this item has been chosen atoms can be selected with the mouse and geometry changes carried out as described in the previous section.
- Add atom
  An atom of the element selected in the periodic table will be attached to the atom in the molecule clicked on with the left mouse button. The new bond will have the bond order selected in the editor dialog box and a bond length which is 90 % of the sum of the atomic radii (read from the `viewmolrc` file). The local geometry of the atom clicked on will be changed to reflect the current coordination of this atom (two bond partners - linear, three - trigonal planar, four - tetrahedral, five - trigonal bipyramidal, six - octahedral, seven - pentagonal bipyramidal etc.).
- Delete atom
  An atom clicked on with the left mouse button will be deleted. If `Deleting atoms` `changes local geometry` is turned on the local geometry of the atom(s) connected to the deleted one will be changed in the same way as described under `Add atom`. Otherwise the local geometry remains as before.
- Replace atom
  The atom clicked on with the left mouse button is replaced by the element selected in the periodic table. Bond lengths are adjusted to reflect the new element as long as the atom changed is not part of a ring.
- Create bond
  A new bond will be created between the two atoms clicked on with the left mouse button. This bond will have the order selected under `Bonds are`.
- Remove bond
  The bond between the two atoms clicked on with the left mouse button is deleted. Bonds created or removed by the user have precedence over bonds created automatically. This means that once a bond has been created by the user only the user can remove it and vice versa regardless of what happens to the molecule.
- Change bond order
  The bond between the two atoms clicked on with the left mouse button is assigned the bond border selected under `Bonds are`.
- Torsion angles default to
  While building a molecule bond lengths of newly created bonds are set to 90 % of the sum of the atomic radii of the bonded atoms and bond angles are assigned according to the coordination. Torsion angles can be selected from this menu. Available values are trans (180o), cis (90o), gauche (60o), and -gauche (-60o). This allows the construction of more complicated molecules. The torsion angle is always measured along the backbone of a molecule, i. e. while building e. g. a hydrocarbon chain the torsion angle is always measured between the carbon atoms. The backbone of a molecule is determined by counting all atoms attached to one atom and following the bonds which connect the atoms with the largest number of other atoms attached.
- Bonds are
  This menu allows the selection of the bond order for bonds. Available are single, double, and triple. Bond conjugation and hydrogen bonds are determined automatically according to the respective settings in the `Bond type` menu.
- Deleting atoms changes local geometry
  If an atom is deleted the local geometry of the atom(s) bonded to it can either be left unchanged or modified according to the new coordination. This switch can be used to select which behavior is preferred.

In the bottom row of the molecule editor dialog box is a button `Undo geometry` `change` which can be used to reverse all changes to the molecule (except changes to bonds). The number of undos is unlimited.