How can I create a dictionary with no duplicate values from a dictionary that may have duplicate values?
IDictionary myDict = new Dicti
Just a footnote to those using the Revit API, this is one method that works for me in removing duplicate elements, when you can't use say wallType as your object type and instead need to leverage raw elements. it's a beaut mate.
//Add Pair.value to known values HashSet
HashSet knownValues = new HashSet();
Dictionary uniqueValues = new Dictionary();
foreach (var pair in wall_Dict)
{
if (knownValues.Add(pair.Value))
{
uniqueValues.Add(pair.Key, pair.Value);
}
}