When compile with Revit 2022 : Error CS0122 'DisplayUnitType' is inaccessible due to its protection level
Have you a solution ?
Welcome to the club.
Hi,
I am looking for the type of unit from a character string.
value1 = string (example : "DUT_METERS", "DUT_SQUARE_METERS", "DUT_WATTS_PER_SQUARE_METER_KELVIN")
my code :
DisplayUnitType RevitMKS = DisplayUnitType.DUT_GENERAL;
if (value1 != "")
{
foreach (DisplayUnitType P in Enum.GetValues(typeof(DisplayUnitType)))
{
if (P.ToString() == value1)
{
RevitMKS = P;
break;
}
}
}
how to do the equivalent?
The method ListForgeTypeIds in The Building Coder samples Util.cs module probably does that for you:
Sorry, but page not found.
Yes, but ))
It is the same info?
The Building Coder: ForgeTypeId and Units Revisited (typepad.com)
Can't find what you're looking for? Ask the community or share your knowledge.