Index: doc/userguide/userguide.xml
===================================================================
--- doc/userguide/userguide.xml	(revision 2a28cd833d2139aba7c9b608010c5ce108d39082)
+++ doc/userguide/userguide.xml	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -939,4 +939,15 @@
    found between any pair of these is removed.</para>
         </section>
+        <section xml:id="bond.set-bond-degree">
+          <title xml:id="bond.set-bond-degree.title">Setting the bond degree manually </title>
+          <para>The bond degrees are usually automatically set to fulfill the 
+          valency constraints of each bond partner. However, degrees can also be 
+          set manually for a set of selected atoms. Note that the degree is set
+          to the given value for all bonds in between any pair of atoms within
+          the set.</para>
+          <programlisting>... --set-bond-degree 2</programlisting>
+          <para>Similarly, if more than two atoms are selected, then all bonds
+   found between any pair of these are modified.</para>
+        </section>
         <section xml:id="bond.save-bonds">
           <title xml:id="bond.save-bonds.title">Saving bond information </title>
Index: src/Actions/BondAction/BondSetDegreeAction.cpp
===================================================================
--- src/Actions/BondAction/BondSetDegreeAction.cpp	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ src/Actions/BondAction/BondSetDegreeAction.cpp	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,174 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2016 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * BondSetDegreeAction.cpp
+ *
+ *  Created on: Oct 01, 2016
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "Atom/atom.hpp"
+#include "Bond/bond.hpp"
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+#include "CodePatterns/Verbose.hpp"
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include "World.hpp"
+#include "WorldTime.hpp"
+
+#include <iostream>
+#include <string>
+
+#include "Actions/BondAction/BondSetDegreeAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "BondSetDegreeAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr BondSetDegreeAction::performCall() {
+  // check preconditions
+  World& world = World::getInstance();
+  if (world.countSelectedAtoms() <= 1) {
+    ELOG(1, "There must be at least two atoms selected for BondSetDegreeAction.");
+    return Action::failure;
+  }
+  for (World::AtomSelectionConstIterator firstiter = world.beginAtomSelection();
+      firstiter != world.endAtomSelection(); ++firstiter) {
+    bool status = false;
+    for (World::AtomSelectionConstIterator seconditer = world.beginAtomSelection();
+        seconditer != world.endAtomSelection(); ++seconditer) {
+      if (firstiter == seconditer)
+        continue;
+      if ((firstiter->second)->IsBondedTo(WorldTime::getTime(), seconditer->second)) {
+        status = true;
+      }
+    }
+    if (!status) {
+      ELOG(1, "Selected atom #" << firstiter->second->getId() << " has no bonds.");
+      return Action::failure;
+    }
+  }
+
+  // store current degrees in vector
+  BondDegrees_t BondDegrees;
+  for (World::AtomSelectionConstIterator firstiter = world.beginAtomSelection();
+      firstiter != world.endAtomSelection(); ++firstiter) {
+    for (World::AtomSelectionConstIterator seconditer = firstiter;
+        seconditer != world.endAtomSelection(); ++seconditer) {
+      if (firstiter == seconditer)
+        continue;
+      if ((firstiter->second)->IsBondedTo(WorldTime::getTime(), seconditer->second)) {
+        bond::ptr bond = (firstiter->second)->getBond(seconditer->second);
+        BondInfo bondinfo(bond);
+        BondDegrees.push_back( bondinfo );
+      }
+    }
+  }
+  if (BondDegrees.empty()) {
+    ELOG(1, "All bonds are already present.");
+    return Action::failure;
+  }
+
+  // create undo state
+  BondSetDegreeState *UndoState = new BondSetDegreeState(BondDegrees, params);
+
+  // execute action
+  for (BondDegrees_t::const_iterator iter = BondDegrees.begin();
+      iter != BondDegrees.end(); ++iter) {
+    atom *firstatom = world.getAtom(AtomById((*iter).leftid));
+    atom *secondatom = world.getAtom(AtomById((*iter).rightid));
+    ASSERT((firstatom != NULL) && (secondatom != NULL),
+        "BondSetDegreeAction::performCall() - at least one of the ids "
+        +toString((*iter).leftid)+" or "+toString((*iter).rightid)+" is not present.");
+    const bond::ptr bond = firstatom->getBond(secondatom);
+    bond->setDegree(params.degree.get());
+  }
+
+  return ActionState::ptr(UndoState);
+}
+
+ActionState::ptr BondSetDegreeAction::performUndo(ActionState::ptr _state) {
+  BondSetDegreeState *state = assert_cast<BondSetDegreeState*>(_state.get());
+
+  // check whether bond already existed
+  World& world = World::getInstance();
+  for (BondDegrees_t::const_iterator iter = state->bonddegrees.begin();
+      iter != state->bonddegrees.end(); ++iter) {
+    atom *firstatom = world.getAtom(AtomById((*iter).leftid));
+    atom *secondatom = world.getAtom(AtomById((*iter).rightid));
+    ASSERT((firstatom != NULL) && (secondatom != NULL),
+        "BondSetDegreeAction::performUndo() - at least one of the ids "
+        +toString((*iter).leftid)+" or "+toString((*iter).rightid)+" is not present.");
+    if (firstatom->IsBondedTo(WorldTime::getTime(), secondatom)) {
+      const bond::ptr bond = firstatom->getBond(secondatom);
+      bond->setDegree((*iter).degree);
+    } else {
+      ELOG(2, "There is no bond in between "+toString((*iter).leftid)
+          +" and "+toString((*iter).rightid)+".");
+    }
+  }
+
+  return ActionState::ptr(_state);
+}
+
+ActionState::ptr BondSetDegreeAction::performRedo(ActionState::ptr _state){
+  BondSetDegreeState *state = assert_cast<BondSetDegreeState*>(_state.get());
+
+  // check whether bond already existed
+  World& world = World::getInstance();
+  for (BondDegrees_t::const_iterator iter = state->bonddegrees.begin();
+      iter != state->bonddegrees.end(); ++iter) {
+    atom * const firstatom = world.getAtom(AtomById((*iter).leftid));
+    atom * const secondatom = world.getAtom(AtomById((*iter).rightid));
+    ASSERT((firstatom != NULL) && (secondatom != NULL),
+        "BondSetDegreeAction::performRedo() - at least one of the ids "
+        +toString((*iter).leftid)+" or "+toString((*iter).rightid)+" is not present.");
+    if (firstatom->IsBondedTo(WorldTime::getTime(), secondatom)) {
+      const bond::ptr bond = firstatom->getBond(secondatom);
+      bond->setDegree(state->params.degree.get());
+    } else {
+      ELOG(2, "There is no bond in between "+toString((*iter).leftid)
+          +" and "+toString((*iter).rightid)+".");
+    }
+  }
+
+  return ActionState::ptr(_state);
+}
+
+bool BondSetDegreeAction::canUndo() {
+  return true;
+}
+
+bool BondSetDegreeAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/BondAction/BondSetDegreeAction.def
===================================================================
--- src/Actions/BondAction/BondSetDegreeAction.def	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ src/Actions/BondAction/BondSetDegreeAction.def	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,43 @@
+/*
+ * BondSetDegreeAction.def
+ *
+ *  Created on: Oct 01, 2016
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include "types.hpp"
+#include <vector>
+#include <utility>
+
+#include "Bond/BondInfo.hpp"
+
+typedef std::vector<BondInfo> BondDegrees_t;
+
+#include "Parameters/Validators/RangeValidator.hpp"
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
+//#define paramtypes (const element *)(BoxVector) TODO: use a validator
+#define paramtypes (int)
+#define paramtokens ("set-bond-degree")
+#define paramdescriptions ("new bond degree for each bond") 
+#define paramreferences (degree)
+#define paramdefaults (PARAM_DEFAULT(1))
+#define paramvalids \
+(RangeValidator<int>(1,10))
+
+#define statetypes (BondDegrees_t)
+#define statereferences (bonddegrees)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Bond
+#define MENUNAME "bond"
+#define MENUPOSITION 3
+#define ACTIONNAME SetDegree
+#define TOKEN "set-bond-degree"
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "sets the bond degree for all selected pairs of atoms"
+#undef SHORTFORM
Index: src/Actions/BondAction/BondSetDegreeAction.hpp
===================================================================
--- src/Actions/BondAction/BondSetDegreeAction.hpp	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ src/Actions/BondAction/BondSetDegreeAction.hpp	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,22 @@
+/*
+ * BondSetDegreeAction.hpp
+ *
+ *  Created on: Oct 01, 2016
+ *      Author: heber
+ */
+
+#ifndef BONDSETDEGREEACTION_HPP_
+#define BONDSETDEGREEACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "BondSetDegreeAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* BONDSETDEGREEACTION_HPP_ */
Index: src/Actions/GlobalListOfActions.hpp
===================================================================
--- src/Actions/GlobalListOfActions.hpp	(revision 2a28cd833d2139aba7c9b608010c5ce108d39082)
+++ src/Actions/GlobalListOfActions.hpp	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -41,4 +41,5 @@
   (BondAdd) \
   (BondRemove) \
+  (BondSetDegree) \
   (CommandDryRun) \
   (CommandElementDb) \
Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision 2a28cd833d2139aba7c9b608010c5ce108d39082)
+++ src/Actions/Makefile.am	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -178,11 +178,14 @@
 BONDACTIONSOURCE = \
   Actions/BondAction/BondAddAction.cpp \
-  Actions/BondAction/BondRemoveAction.cpp
+  Actions/BondAction/BondRemoveAction.cpp \
+  Actions/BondAction/BondSetDegreeAction.cpp
 BONDACTIONHEADER = \
   Actions/BondAction/BondAddAction.hpp \
-  Actions/BondAction/BondRemoveAction.hpp
+  Actions/BondAction/BondRemoveAction.hpp \
+  Actions/BondAction/BondSetDegreeAction.hpp
 BONDACTIONDEFS = \
   Actions/BondAction/BondAddAction.def \
-  Actions/BondAction/BondRemoveAction.def
+  Actions/BondAction/BondRemoveAction.def \
+  Actions/BondAction/BondSetDegreeAction.def
 
 CMDACTIONSOURCE = \
Index: tests/Python/AllActions/options.dat
===================================================================
--- tests/Python/AllActions/options.dat	(revision 2a28cd833d2139aba7c9b608010c5ce108d39082)
+++ tests/Python/AllActions/options.dat	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -205,4 +205,5 @@
 server-port	"1026"
 session-type	"cli"
+set-bond-degree	"1"
 set-boundary-conditions	"Wrap, Wrap, Wrap"
 set-max-iterations	"10"
Index: tests/regression/Bond/SetDegree/post/test.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/post/test.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,7 @@
+REMARK created by molecuilder on Thu Apr 12 18:16:56 2012, time step 0
+ATOM      1 O01 0non 01          0.000   0.000   0.000  0.00  0.00           O 0
+ATOM      2 H01 0wat 01          0.759   0.000   0.504  0.00  0.00           H 0
+ATOM      3 H02 0non 01          0.759   0.000  -0.504  0.00  0.00           H 0
+CONECT    1    2                                                                
+CONECT    2    1                                                                
+END
Index: tests/regression/Bond/SetDegree/post/test_degree1.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test_degree1.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/post/test_degree1.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,18 @@
+REMARK created by molecuilder on Sat Oct  1 19:58:03 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 H01 0tes 01          5.000   6.125   4.602  0.00  0.00           H 0
+ATOM      4 H02 0tes 01          4.026   4.438   4.602  0.00  0.00           H 0
+ATOM      5 H03 0tes 01          5.974   4.438   4.602  0.00  0.00           H 0
+ATOM      6 H04 0tes 01          5.000   6.125   6.798  0.00  0.00           H 0
+ATOM      7 H05 0tes 01          5.974   4.438   6.798  0.00  0.00           H 0
+ATOM      8 H06 0tes 01          4.026   4.438   6.798  0.00  0.00           H 0
+CONECT    1    2    3    4    5                                                 
+CONECT    2    1    6    7    8                                                 
+CONECT    3    1                                                                
+CONECT    4    1                                                                
+CONECT    5    1                                                                
+CONECT    6    2                                                                
+CONECT    7    2                                                                
+CONECT    8    2                                                                
+END
Index: tests/regression/Bond/SetDegree/post/test_degree2.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test_degree2.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/post/test_degree2.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,14 @@
+REMARK created by molecuilder on Sat Oct  1 19:58:03 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 H01 0tes 01          4.438   4.205   4.311  0.00  0.00           H 0
+ATOM      4 H02 0tes 01          5.562   5.795   4.311  0.00  0.00           H 0
+ATOM      5 H03 0tes 01          5.562   5.795   7.089  0.00  0.00           H 0
+ATOM      6 H04 0tes 01          4.438   4.205   7.089  0.00  0.00           H 0
+CONECT    1    2    3    4                                                      
+CONECT    2    1    5    6                                                      
+CONECT    3    1                                                                
+CONECT    4    1                                                                
+CONECT    5    2                                                                
+CONECT    6    2                                                                
+END
Index: tests/regression/Bond/SetDegree/post/test_multiple.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test_multiple.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/post/test_multiple.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,8 @@
+REMARK created by molecuilder on Wed Jan 28 21:45:49 2015, time step 0
+ATOM      1 H01 0non 01          0.000   0.000   0.000  0.00  0.00           O 0
+ATOM      2 H01 0wat 01          0.759   0.000   0.504  0.00  0.00           H 0
+ATOM      3 H02 0non 01          0.759   0.000  -0.504  0.00  0.00           H 0
+CONECT    1    2    3                                                           
+CONECT    2    1    3                                                           
+CONECT    3    1    2                                                           
+END
Index: tests/regression/Bond/SetDegree/post/test_multiple_degree1.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test_multiple_degree1.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/post/test_multiple_degree1.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,34 @@
+REMARK created by molecuilder on Sat Oct  1 19:58:03 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 C03 0tes 01         10.000   5.000   5.000  0.00  0.00           C 0
+ATOM      4 C04 0tes 01         10.000   5.000   6.400  0.00  0.00           C 0
+ATOM      5 H01 0tes 01          5.000   6.125   4.602  0.00  0.00           H 0
+ATOM      6 H02 0tes 01          4.026   4.438   4.602  0.00  0.00           H 0
+ATOM      7 H03 0tes 01          5.974   4.438   4.602  0.00  0.00           H 0
+ATOM      8 H04 0tes 01          5.000   6.125   6.798  0.00  0.00           H 0
+ATOM      9 H05 0tes 01          5.974   4.438   6.798  0.00  0.00           H 0
+ATOM     10 H06 0tes 01          4.026   4.438   6.798  0.00  0.00           H 0
+ATOM     11 H07 0tes 01         10.000   6.125   4.602  0.00  0.00           H 0
+ATOM     12 H08 0tes 01          9.026   4.438   4.602  0.00  0.00           H 0
+ATOM     13 H09 0tes 01         10.974   4.438   4.602  0.00  0.00           H 0
+ATOM     14 H10 0tes 01         10.000   6.125   6.798  0.00  0.00           H 0
+ATOM     15 H11 0tes 01         10.974   4.438   6.798  0.00  0.00           H 0
+ATOM     16 H12 0tes 01          9.026   4.438   6.798  0.00  0.00           H 0
+CONECT    1    2    5    6    7                                                 
+CONECT    2    1    8    9   10                                                 
+CONECT    3    4   11   12   13                                                 
+CONECT    4    3   14   15   16                                                 
+CONECT    5    1                                                                
+CONECT    6    1                                                                
+CONECT    7    1                                                                
+CONECT    8    2                                                                
+CONECT    9    2                                                                
+CONECT   10    2                                                                
+CONECT   11    3                                                                
+CONECT   12    3                                                                
+CONECT   13    3                                                                
+CONECT   14    4                                                                
+CONECT   15    4                                                                
+CONECT   16    4                                                                
+END
Index: tests/regression/Bond/SetDegree/post/test_multiple_degree2.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test_multiple_degree2.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/post/test_multiple_degree2.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,26 @@
+REMARK created by molecuilder on Sat Oct  1 19:58:03 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 C03 0tes 01         10.000   5.000   5.000  0.00  0.00           C 0
+ATOM      4 C04 0tes 01         10.000   5.000   6.400  0.00  0.00           C 0
+ATOM      5 H01 0tes 01          4.438   4.205   4.311  0.00  0.00           H 0
+ATOM      6 H02 0tes 01          5.562   5.795   4.311  0.00  0.00           H 0
+ATOM      7 H03 0tes 01          5.562   5.795   7.089  0.00  0.00           H 0
+ATOM      8 H04 0tes 01          4.438   4.205   7.089  0.00  0.00           H 0
+ATOM      9 H05 0tes 01          9.438   4.205   4.311  0.00  0.00           H 0
+ATOM     10 H06 0tes 01         10.562   5.795   4.311  0.00  0.00           H 0
+ATOM     11 H07 0tes 01         10.562   5.795   7.089  0.00  0.00           H 0
+ATOM     12 H08 0tes 01          9.438   4.205   7.089  0.00  0.00           H 0
+CONECT    1    2    5    6                                                      
+CONECT    2    1    7    8                                                      
+CONECT    3    4    9   10                                                      
+CONECT    4    3   11   12                                                      
+CONECT    5    1                                                                
+CONECT    6    1                                                                
+CONECT    7    2                                                                
+CONECT    8    2                                                                
+CONECT    9    3                                                                
+CONECT   10    3                                                                
+CONECT   11    4                                                                
+CONECT   12    4                                                                
+END
Index: tests/regression/Bond/SetDegree/pre/.pdb
===================================================================
--- tests/regression/Bond/SetDegree/pre/.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/pre/.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,4 @@
+REMARK created by molecuilder on Sat Oct  1 19:45:11 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+END
Index: tests/regression/Bond/SetDegree/pre/test.pdb
===================================================================
--- tests/regression/Bond/SetDegree/pre/test.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/pre/test.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,6 @@
+REMARK created by molecuilder on Sat Oct  1 19:45:55 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+CONECT    1    2                                                                
+CONECT    2    1                                                                
+END
Index: tests/regression/Bond/SetDegree/pre/test_multiple.pdb
===================================================================
--- tests/regression/Bond/SetDegree/pre/test_multiple.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/pre/test_multiple.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,10 @@
+REMARK created by molecuilder on Sat Oct  1 19:45:55 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 C03 0tes 01          10.00   5.000   5.000  0.00  0.00           C 0
+ATOM      4 C04 0tes 01          10.00   5.000   6.400  0.00  0.00           C 0
+CONECT    1    2                                                                
+CONECT    2    1                                                                
+CONECT    3    4                                                                
+CONECT    4    3                                                                
+END
Index: tests/regression/Bond/SetDegree/pre/test_multiple_fail.pdb
===================================================================
--- tests/regression/Bond/SetDegree/pre/test_multiple_fail.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/pre/test_multiple_fail.pdb	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,11 @@
+REMARK created by molecuilder on Sat Oct  1 19:45:55 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 C03 0tes 01          10.00   5.000   5.000  0.00  0.00           C 0
+ATOM      4 C04 0tes 01          10.00   5.000   6.400  0.00  0.00           C 0
+ATOM      5 C05 0tes 01          15.00   5.000   5.000  0.00  0.00           C 0
+CONECT    1    2                                                                
+CONECT    2    1                                                                
+CONECT    3    4                                                                
+CONECT    4    3                                                                
+END
Index: tests/regression/Bond/SetDegree/testsuite-bond-set-degree.at
===================================================================
--- tests/regression/Bond/SetDegree/testsuite-bond-set-degree.at	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/testsuite-bond-set-degree.at	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,47 @@
+#
+#    MoleCuilder - creates and alters molecular systems
+#    Copyright (C) 2016 Frederik Heber
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+### set degree
+
+AT_SETUP([Bond - changing degree])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms])
+file=test.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-atom-by-id 0 1 --set-bond-degree 2 --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_degree2.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
+
+
+AT_SETUP([Bond - changing degree with Undo])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms undo])
+file=test.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-atom-by-id 0 1 --set-bond-degree 2 --undo --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_degree1.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
+
+
+AT_SETUP([Bond - changing degree with Redo])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms redo])
+file=test.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-atom-by-id 0 1 --set-bond-degree 2 --undo --redo --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_degree2.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
Index: tests/regression/Bond/SetDegree/testsuite-bond-set-degree_multiple.at
===================================================================
--- tests/regression/Bond/SetDegree/testsuite-bond-set-degree_multiple.at	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
+++ tests/regression/Bond/SetDegree/testsuite-bond-set-degree_multiple.at	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -0,0 +1,55 @@
+#
+#    MoleCuilder - creates and alters molecular systems
+#    Copyright (C) 2016 Frederik Heber
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+### set degree
+
+AT_SETUP([Bond - changing multiple degrees])
+AT_KEYWORDS([bond set-bond-degree])
+file=test_multiple.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-all-atoms --set-bond-degree 2 --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_multiple_degree2.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
+
+
+AT_SETUP([Bond - changing multiple degrees with Undo])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms undo])
+file=test_multiple.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-all-atoms --set-bond-degree 2 --undo --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_multiple_degree1.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
+
+
+AT_SETUP([Bond - changing multiple degrees with Redo])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms redo])
+file=test_multiple.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-all-atoms --set-bond-degree 2 --undo --redo --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_multiple_degree2.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
+
+AT_SETUP([Bond - changing multiple degrees, not all have bonds])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms])
+file=test_multiple_fail.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-all-atoms --set-bond-degree 2], 5, [ignore], [ignore])
+AT_CLEANUP
Index: tests/regression/Bond/testsuite-bond.at
===================================================================
--- tests/regression/Bond/testsuite-bond.at	(revision 2a28cd833d2139aba7c9b608010c5ce108d39082)
+++ tests/regression/Bond/testsuite-bond.at	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -28,2 +28,7 @@
 # adjacency matcher
 m4_include([Bond/AdjacencyMatcher/testsuite-bond-adjacencymatcher.at])
+
+# set degree
+m4_include([Bond/SetDegree/testsuite-bond-set-degree.at])
+m4_include([Bond/SetDegree/testsuite-bond-set-degree_multiple.at])
+
Index: tests/regression/Makefile.am
===================================================================
--- tests/regression/Makefile.am	(revision 2a28cd833d2139aba7c9b608010c5ce108d39082)
+++ tests/regression/Makefile.am	(revision 596aacf191b75128e8e86114dda85fb17b792e44)
@@ -49,7 +49,9 @@
 	$(srcdir)/Bond/Add/testsuite-bond-add.at \
 	$(srcdir)/Bond/Add/testsuite-bond-add_multiple.at \
+	$(srcdir)/Bond/AdjacencyMatcher/testsuite-bond-adjacencymatcher.at \
 	$(srcdir)/Bond/Remove/testsuite-bond-remove.at \
 	$(srcdir)/Bond/Remove/testsuite-bond-remove_multiple.at \
-	$(srcdir)/Bond/AdjacencyMatcher/testsuite-bond-adjacencymatcher.at \
+	$(srcdir)/Bond/SetDegree/testsuite-bond-set-degree.at \
+	$(srcdir)/Bond/SetDegree/testsuite-bond-set-degree_multiple.at \
 	$(srcdir)/Analysis/testsuite-analysis.at \
 	$(srcdir)/Analysis/DipoleAngularCorrelation/testsuite-analysis-dipole-angular-correlation.at \
