diff --git a/MeshLib/MeshEditing/ElementValueModification.cpp b/MeshLib/MeshEditing/ElementValueModification.cpp
index acefe0d011cd0baf3196b2839a3e0d6f121c9e6e..dee36a008a68bbf4f7db34106af4c113f59efafe 100644
--- a/MeshLib/MeshEditing/ElementValueModification.cpp
+++ b/MeshLib/MeshEditing/ElementValueModification.cpp
@@ -49,32 +49,48 @@ std::vector<unsigned> ElementValueModification::getMeshValues(const MeshLib::Mes
 	return value_mapping;
 }
 
-bool ElementValueModification::replace(MeshLib::Mesh &mesh, unsigned old_value, unsigned new_value, bool replace_if_exists)
+bool ElementValueModification::replace(MeshLib::Mesh &mesh,
+	std::string const& property_name, unsigned old_value, unsigned new_value,
+	bool replace_if_exists)
 {
-	std::vector<unsigned> value_mapping (ElementValueModification::getMeshValues(mesh));
+	boost::optional<MeshLib::PropertyVector<int> &> optional_property_value_vec(
+		mesh.getProperties().getPropertyVector<int>(property_name)
+	);
 
-	if (!replace_if_exists)
-	{
-		const unsigned nValues (value_mapping.size());
-		for (unsigned j=0; j<nValues; ++j)
-		{
-			if (new_value == value_mapping[j])
-			{
-				WARN ("ElementValueModification::replaceElementValue() - Replacement value is already taken, no changes have been made.");
+	if (!optional_property_value_vec) {
+		return false;
+	}
+
+	MeshLib::PropertyVector<int> & property_value_vec(
+		optional_property_value_vec.get()
+	);
+	const std::size_t n_property_values(property_value_vec.size());
+
+	if (!replace_if_exists) {
+		for (std::size_t i=0; i<n_property_values; ++i) {
+			if (property_value_vec[i] == new_value) {
+				WARN ("ElementValueModification::replaceElementValue() "
+					"- Replacement value \"%d\" is already taken, "
+					"no changes have been made.", new_value);
 				return false;
 			}
 		}
 	}
-	const std::size_t nElements (mesh.getNElements());
-	std::vector<MeshLib::Element*> &elements (const_cast<std::vector<MeshLib::Element*>&>(mesh.getElements()));
-	for (unsigned i=0; i<nElements; ++i)
-	{
-		if (elements[i]->getValue() == old_value)
-			elements[i]->setValue(new_value);
+
+	for (std::size_t i=0; i<n_property_values; ++i) {
+		if (property_value_vec[i] == old_value)
+			property_value_vec[i] = new_value;
 	}
+
 	return true;
 }
 
+bool ElementValueModification::replace(MeshLib::Mesh &mesh,
+	unsigned old_value, unsigned new_value, bool replace_if_exists)
+{
+	return replace(mesh, "MaterialIDs", old_value, new_value, replace_if_exists);
+}
+
 unsigned ElementValueModification::condense(MeshLib::Mesh &mesh)
 {
 	boost::optional<MeshLib::PropertyVector<int> &>
diff --git a/MeshLib/MeshEditing/ElementValueModification.h b/MeshLib/MeshEditing/ElementValueModification.h
index 9d38002eb2927d8e819ffd9910dbe6a6e496bc1c..2464c43b574bee637d4a3118feed1ec346b710c0 100644
--- a/MeshLib/MeshEditing/ElementValueModification.h
+++ b/MeshLib/MeshEditing/ElementValueModification.h
@@ -41,6 +41,9 @@ public:
 	/// Returns true if successful or false if the value is already taken.
 	static bool replace(MeshLib::Mesh &mesh, unsigned old_value, unsigned new_value, bool replace_if_exists = false);
 
+	static bool replace(MeshLib::Mesh &mesh, std::string const& property_name,
+		unsigned old_value, unsigned new_value, bool replace_if_exists = false);
+
 	/// Sets new value for all elements having the given element type
 	/// Returns the number of elements having the given element type
 	static unsigned setByElementType(MeshLib::Mesh &mesh, MeshElemType ele_type, unsigned new_value);