Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
Merge branch 'Matteo/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo.cominetti committed Jan 16, 2020
2 parents 4d43649 + 13a35a3 commit 1d5c211
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions SpeckleRevitReboot/UI/SpeckleUiBindings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,18 @@ public object GetAndClearUnitDictionary()
var typessss = type.GetProperties().Select(p => p.Name).ToList();
if (type.GetProperties().Select(p => p.Name).Contains("UnitDictionary"))
{
var copy = new Dictionary<string, string>((Dictionary<string, string>)type.GetProperty("UnitDictionary").GetValue(type));
type.GetProperty("UnitDictionary").SetValue(null, new Dictionary<string, string>());
try
{
var copy = new Dictionary<string, string>((Dictionary<string, string>)type.GetProperty("UnitDictionary").GetValue(type));
type.GetProperty("UnitDictionary").SetValue(null, new Dictionary<string, string>());

return copy;
return copy;
}
catch (Exception e)
{

}
return null;
}
}
}
Expand Down

0 comments on commit 1d5c211

Please sign in to comment.