Closed mimomenome closed 2 years ago
Maybe this?
if (wasParsed && _revitPerameter.GetUnitTypeId() == UnitTypeId.Percentage && dval > 1)
{
dval = dval / 100;
_revitPerameter.Set(dval);
wasSet = true;
}
else if (wasParsed)
{
_revitPerameter.Set(dval);
wasSet = true;
}
Yeah there was a significant change with the units API in Revit 2021/22, it looks like you're on the right track, I have a library which abstracts the units API (currently in a private repo) to support all versions of Revit, I'll look at getting it ported over to this one :)
Is resolved in latest! Thanks!!!
After updating references (which I think worked) - getting the following which appears to be due to a breaking change in the way revit handles units...
line 165 _revitPerameter.DisplayUnitType
Severity Code Description Project File Line Suppression State Error CS1061 'Parameter' does not contain a definition for 'DisplayUnitType' and no accessible extension method 'DisplayUnitType' accepting a first argument of type 'Parameter' could be found (are you missing a using directive or an assembly reference?) BuildingGraph.Integration.Revit D:\Development\metagraph\BuildingGraph-Client-Revit\BuildingGraph.Integration.Revit\Parameters\HLRevitParameter.cs 165 Active
Severity Code Description Project File Line Suppression State Error CS0117 'DisplayUnitType' does not contain a definition for 'DUT_PERCENTAGE' BuildingGraph.Integration.Revit D:\Development\metagraph\BuildingGraph-Client-Revit\BuildingGraph.Integration.Revit\Parameters\HLRevitParameter.cs 165 Active
Cheers! M.