Quantcast
Channel: RevitNetAddinWizard & NavisworksNetAddinWizard
Viewing all 872 articles
Browse latest View live

Revit Units .NET API: List out All Revit Unit Symbols Regardless of Metric or Imperial

$
0
0

Revit .NET has provided the Units API since version 2014. In this series of posts, we are going to explore the Revit Units .NET API and provide sample code and analysis as usual.
Let’s list out all Revit unit symbols regardless of in the metric or imperial system in this post. Here we go.

        public static void ListOutAllRevitUnitSymbols()
        {
            string info = "";
            using (StreamWriter sw = new StreamWriter(@"c:\temp\AllRevitUnitSymbols.txt"))
            {
                foreach (UnitSymbolType ust in Enum.GetValues(typeof(UnitSymbolType)))
                {
                    string padding = "";
                    for (int i = 0; i < 40 - ust.ToString().Length; i++) padding += " ";
                    info = string.Format("{0}{2} => {1}", ust, ust == UnitSymbolType.UST_NONE ? "" : LabelUtils.GetLabelFor(ust), padding);
                    sw.WriteLine(info);
                }
            }
        }

    

RevitUnitsAPI.ListOutAllRevitUnitSymbols();


The output may look something as follows:

UST_NONE                                 =>
UST_M                                    => m
UST_CM                                   => cm
UST_MM                                   => mm
UST_LF                                   => LF
UST_FOOT_SINGLE_QUOTE                    => '
UST_INCH_DOUBLE_QUOTE                    => "
UST_ACRES                                => acres
UST_HECTARES                             => hectare
UST_CY                                   => CY
UST_SF                                   => SF
UST_FT_SUP_2                             => ft²
UST_FT_CARET_2                           => ft^2
UST_M_SUP_2                              => m²
UST_M_CARET_2                            => m^2
UST_CF                                   => CF
UST_FT_SUP_3                             => ft³
UST_FT_CARET_3                           => ft^3
UST_M_SUP_3                              => m³
UST_M_CARET_3                            => m^3
UST_DEGREE_SYMBOL                        => °
UST_PERCENT_SIGN                         => %
UST_IN_SUP_2                             => in²
UST_IN_CARET_2                           => in^2
UST_CM_SUP_2                             => cm²
UST_CM_CARET_2                           => cm^2
UST_MM_SUP_2                             => mm²
UST_MM_CARET_2                           => mm^2
UST_IN_SUP_3                             => in³
UST_IN_CARET_3                           => in^3
UST_CM_SUP_3                             => cm³
UST_CM_CARET_3                           => cm^3
UST_MM_SUP_3                             => mm³
UST_MM_CARET_3                           => mm^3
UST_L                                    => L
UST_GAL                                  => gal
UST_KG_PER_CU_M                          => kg/m³
UST_LB_MASS_PER_CU_FT                    => lb/ft³
UST_LBM_PER_CU_FT                        => lbm/ft³
UST_LB_MASS_PER_CU_IN                    => lb/in³
UST_LBM_PER_CU_IN                        => lbm/in³
UST_BTU                                  => Btu
UST_CAL                                  => cal
UST_KCAL                                 => kcal
UST_JOULE                                => J
UST_KWH                                  => kWh
UST_THERM                                => therm
UST_IN_WG_PER_100FT                      => in-wg/100ft
UST_PASCAL_PER_M                         => Pa/m
UST_WATT                                 => W
UST_KILOWATT                             => kW
UST_BTU_PER_S                            => Btu/s
UST_BTU_PER_H                            => Btu/h
UST_CAL_PER_S                            => cal/s
UST_KCAL_PER_S                           => kcal/s
UST_WATT_PER_SQ_FT                       => W/ft²
UST_WATT_PER_SQ_M                        => W/m²
UST_IN_WG                                => in-wg
UST_PASCAL                               => Pa
UST_KILOPASCAL                           => kPa
UST_MEGAPASCAL                           => MPa
UST_PSI                                  => psi
UST_LB_FORCE_PER_SQ_IN                   => lb/in²
UST_PSIG                                 => psig
UST_PSIA                                 => psia
UST_LBF_PER_SQ_IN                        => lbf/in²
UST_IN_HG                                => inHg
UST_MM_HG                                => mmHg
UST_ATM                                  => atm
UST_BAR                                  => bar
UST_DEGREE_F                             => °F
UST_DEGREE_C                             => °C
UST_KELVIN                               => K
UST_DEGREE_R                             => °R
UST_FT_PER_MIN                           => ft/min
UST_FPM                                  => FPM
UST_M_PER_S                              => m/s
UST_CM_PER_MIN                           => cm/min
UST_CU_FT_PER_MIN                        => ft³/min
UST_CFM                                  => CFM
UST_L_PER_S                              => L/s
UST_LPS                                  => LPS
UST_CU_M_PER_S                           => m³/s
UST_CMS                                  => CMS
UST_CU_M_PER_H                           => m³/h
UST_CMH                                  => CMH
UST_GAL_PER_MIN                          => gal/min
UST_GPM                                  => GPM
UST_USGPM                                => usgpm
UST_GAL_PER_H                            => gal/h
UST_GPH                                  => GPH
UST_USGPH                                => usgph
UST_AMPERE                               => A
UST_KILOAMPERE                           => kA
UST_MILLIAMPERE                          => mA
UST_VOLT                                 => V
UST_KILOVOLT                             => kV
UST_MILLIVOLT                            => mV
UST_HZ                                   => Hz
UST_CPS                                  => cps
UST_LX                                   => lx
UST_FC                                   => fc
UST_FTC                                  => Ftc
UST_FL                                   => fL
UST_FL_LOWERCASE                         => fl
UST_FTL                                  => ftL
UST_CD_PER_SQ_M                          => cd/m²
UST_CD                                   => cd
UST_LM                                   => lm
UST_VOLTAMPERE                           => VA
UST_KILOVOLTAMPERE                       => kVA
UST_HP                                   => hp
UST_N                                    => N
UST_DA_N                                 => daN
UST_K_N                                  => kN
UST_M_N                                  => MN
UST_KIP                                  => kip
UST_KGF                                  => kgf
UST_TF                                   => Tf
UST_LB_FORCE                             => lb
UST_LBF                                  => lbf
UST_N_PER_M                              => N/m
UST_DA_N_PER_M                           => daN/m
UST_K_N_PER_M                            => kN/m
UST_M_N_PER_M                            => MN/m
UST_KIP_PER_FT                           => kip/ft
UST_KGF_PER_M                            => kgf/m
UST_TF_PER_M                             => Tf/m
UST_LB_FORCE_PER_FT                      => lb/ft
UST_LBF_PER_FT                           => lbf/ft
UST_N_PER_M_SUP_2                        => N/m²
UST_DA_N_PER_M_SUP_2                     => daN/m²
UST_K_N_PER_M_SUP_2                      => kN/m²
UST_M_N_PER_M_SUP_2                      => MN/m²
UST_KSF                                  => ksf
UST_KIP_PER_SQ_FT                        => kip/ft²
UST_KGF_PER_M_SUP_2                      => kgf/m²
UST_TF_PER_M_SUP_2                       => Tf/m²
UST_PSF                                  => psf
UST_LB_FORCE_PER_SQ_FT                   => lb/ft²
UST_LBF_PER_SQ_FT                        => lbf/ft²
UST_N_DASH_M                             => N-m
UST_DA_N_DASH_M                          => daN-m
UST_K_N_DASH_M                           => kN-m
UST_M_N_DASH_M                           => MN-m
UST_KIP_DASH_FT                          => kip-ft
UST_KGF_DASH_M                           => kgf-m
UST_TF_DASH_M                            => Tf-m
UST_LB_FORCE_DASH_FT                     => lb-ft
UST_LBF_DASH_FT                          => lbf-ft
UST_M_PER_K_N                            => m/kN
UST_FT_PER_KIP                           => ft/kip
UST_M_SUP_2_PER_K_N                      => m²/kN
UST_FT_SUP_2_PER_KIP                     => ft²/kip
UST_M_SUP_3_PER_K_N                      => m³/kN
UST_FT_SUP_3_PER_KIP                     => ft³/kip
UST_INV_K_N                              => 1/kN
UST_INV_KIP                              => 1/kip
UST_FTH2O_PER_100FT                      => ftH2O/100ft
UST_FT_OF_WATER_PER_100FT                => FT/100ft
UST_FEET_OF_WATER_PER_100FT              => Feet/100ft
UST_FTH2O                                => ftH2O
UST_FT_OF_WATER                          => FT
UST_FEET_OF_WATER                        => Feet
UST_PA_S                                 => Pa-s
UST_LB_FORCE_PER_FT_S                    => lb/ft-s
UST_LBM_PER_FT_S                         => lbm/ft-s
UST_CP                                   => cP
UST_FT_PER_S                             => ft/s
UST_FPS                                  => FPS
UST_KSI                                  => ksi
UST_KIP_PER_SQ_IN                        => kip/in²
UST_KN_PER_M_SUP_3                       => kN/m³
UST_LB_FORCE_PER_CU_FT                   => lb/ft³
UST_LBF_PER_CU_FT                        => lbf/ft³
UST_KIP_PER_IN_SUP_3                     => kip/in³
UST_INV_DEGREE_F                         => 1/°F
UST_INV_DEGREE_C                         => 1/°C
UST_N_DASH_M_PER_M                       => N-m/m
UST_DA_N_DASH_M_PER_M                    => daN-m/m
UST_K_N_DASH_M_PER_M                     => kN-m/m
UST_M_N_DASH_M_PER_M                     => MN-m/m
UST_KIP_DASH_FT_PER_FT                   => kip-ft/ft
UST_KGF_DASH_M_PER_M                     => kgf-m/m
UST_TF_DASH_M_PER_M                      => Tf-m/m
UST_LB_FORCE_DASH_FT_PER_FT              => lb-ft/ft
UST_LBF_DASH_FT_PER_FT                   => lbf-ft/ft
UST_LB_FORCE_PER_FT_H                    => lb/ft-h
UST_LBM_PER_FT_H                         => lbm/ft-h
UST_KIPS_PER_IN                          => kip/in
UST_KIPS_PER_CU_FT                       => kip/ft³
UST_KIP_FT_PER_DEGREE                    => kip-ft/°
UST_K_N_M_PER_DEGREE                     => kN-m/°
UST_KIP_FT_PER_DEGREE_PER_FT             => kip-ft/°/ft
UST_K_N_M_PER_DEGREE_PER_M               => kN-m/°/m
UST_WATT_PER_SQ_M_K                      => W/(m²•K)
UST_BTU_PER_H_SQ_FT_DEGREE_F             => BTU/(h•ft²•°F)
UST_CFM_PER_SQ_FT                        => CFM/ft²
UST_CFM_PER_SF                           => CFM/SF
UST_LPS_PER_SQ_M                         => LPS/m²
UST_L_PER_S_SQ_M                         => L/(s•m²)
UST_COLON_10                             => :10
UST_COLON_12                             => :12
UST_SLOPE_DEGREE_SYMBOL                  => °
UST_WATT_PER_CU_FT                       => W/ft³
UST_WATT_PER_CU_M                        => W/m³
UST_BTU_PER_H_SQ_FT                      => Btu/(h•ft²)
UST_BTU_PER_H_CU_FT                      => Btu/(h•ft³)
UST_TON                                  => ton
UST_CFM_PER_CU_FT                        => CFM/ft³
UST_CFM_PER_CF                           => CFM/CF
UST_L_PER_S_CU_M                         => L/(s•m³)
UST_CFM_PER_TON                          => CFM/ton
UST_L_PER_S_KW                           => L/(s•kW)
UST_SQ_FT_PER_TON                        => ft²/ton
UST_SF_PER_TON                           => SF/ton
UST_SQ_M_PER_KW                          => m²/kW
UST_DOLLAR                               => $
UST_EURO_SUFFIX                          => €
UST_EURO_PREFIX                          => €
UST_POUND                                => £
UST_YEN                                  => ¥
UST_CHINESE_HONG_KONG_SAR                => HK$
UST_WON                                  => ₩
UST_SHEQEL                               => ₪
UST_DONG                                 => ₫
UST_BAHT                                 => ฿
UST_KRONER                               => kr
UST_LM_PER_W                             => lm/W
UST_SF_PER_MBH                           => SF/MBh
UST_SF_PER_KBTU_PER_H                    => SF•h/kBtu
UST_SQ_FT_PER_MBH                        => ft²/MBh
UST_SQ_FT_PER_KBTU_PER_H                 => ft²•h/kBtu
UST_K_N_PER_CM_SUP_2                     => kN/cm²
UST_N_PER_MM_SUP_2                       => N/mm²
UST_K_N_PER_MM_SUP_2                     => kN/mm²
UST_ONE_COLON                            => 1:
UST_H_SQ_FT_DEGREE_F_PER_BTU             => (h•ft²•°F)/BTU
UST_SQ_M_K_PER_WATT                      => (m²•K)/W
UST_BTU_PER_F                            => BTU/°F
UST_J_PER_KELVIN                         => J/K
UST_KJ_PER_KELVIN                        => kJ/K
UST_KGM                                  => kg
UST_TM                                   => t
UST_LB_MASS                              => lb
UST_LBM                                  => lbm
UST_M_PER_SQ_S                           => m/s²
UST_KM_PER_SQ_S                          => km/s²
UST_IN_PER_SQ_S                          => in/s²
UST_FT_PER_SQ_S                          => ft/s²
UST_MI_PER_SQ_S                          => mi/s²
UST_FT_SUP_4                             => ft4
UST_IN_SUP_4                             => in4
UST_MM_SUP_4                             => mm4
UST_CM_SUP_4                             => cm4
UST_M_SUP_4                              => m4
UST_FT_SUP_6                             => ft6
UST_IN_SUP_6                             => in6
UST_MM_SUP_6                             => mm6
UST_CM_SUP_6                             => cm6
UST_M_SUP_6                              => m6
UST_SQ_FT_PER_FT                         => ft²/ft
UST_SQ_IN_PER_FT                         => in²/ft
UST_SQ_MM_PER_M                          => mm²/m
UST_SQ_CM_PER_M                          => cm²/m
UST_SQ_M_PER_M                           => m²/m
UST_KGM_PER_M                            => kg/m
UST_LB_MASS_PER_FT                       => lb/ft
UST_LBM_PER_FT                           => lbm/ft
UST_RAD                                  => rad
UST_GRAD                                 => grad
UST_RAD_PER_S                            => rad/s
UST_MS                                   => ms
UST_S                                    => s
UST_MIN                                  => min
UST_H                                    => h
UST_KM_PER_H                             => km/h
UST_MI_PER_H                             => mph
UST_KJ                                   => kJ
UST_KGM_PER_SQ_M                         => kg/m²
UST_LBM_PER_SQ_FT                        => lb/ft²
UST_WATTS_PER_METER_KELVIN               => W/(m•K)
UST_J_PER_G_CELSIUS                      => J/(g•°C)
UST_J_PER_G                              => J/g
UST_NG_PER_PA_S_SQ_M                     => ng/(Pa•s•m²)
UST_OHM_M                                => ohm•m
UST_BTU_PER_H_FT_DEGREE_F                => BTU/(h•ft•°F)
UST_BTU_PER_LB_DEGREE_F                  => BTU/(lb•°F)
UST_BTU_PER_LB                           => BTU/lb
UST_GR_PER_H_SQ_FT_IN_HG                 => gr/(h•ft²•inHg)
UST_PER_MILLE_SIGN                       => ‰
UST_DM                                   => dm
UST_J_PER_KG_CELSIUS                     => J/(kg•°C)
UST_UM_PER_M_C                           => µm/(m•°C)
UST_UIN_PER_IN_F                         => µin/(in•°F)

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.


Revit Units .NET API: List out All Revit Valid Units Per Valid UnitType

$
0
0

Revit .NET has provided the Units API since version 2014. In this series of posts, we are going to explore the Revit Units .NET API and provide sample code and analysis as usual.
Let’s list out all valid Revit units for each valid unit type (the API enum UnitType).

        public static void ListOutUnitsPerUnitType()
        {
            string info = "";
            using (StreamWriter sw = new StreamWriter(@"c:\temp\RevitValidUnitsPerValidUnitType.txt"))
            {
                foreach (UnitType ut in UnitUtils.GetValidUnitTypes())
                {
                    info = string.Format("{0} -- {1}", ut, LabelUtils.GetLabelFor(ut));
                    sw.WriteLine(info);
                    foreach (DisplayUnitType dut in UnitUtils.GetValidDisplayUnits(ut))
                    {
                        info = string.Format("\t{0} -- {1}", dut, LabelUtils.GetLabelFor(dut));
                        sw.WriteLine(info);
                    }
                }
            }
        }

    

RevitUnitsAPI.ListOutUnitsPerUnitType();


The output may look something as follows:

UT_Length -- Length
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Area -- Area
    DUT_SQUARE_FEET -- Square feet
    DUT_SQUARE_INCHES -- Square inches
    DUT_SQUARE_METERS -- Square meters
    DUT_SQUARE_CENTIMETERS -- Square centimeters
    DUT_SQUARE_MILLIMETERS -- Square millimeters
    DUT_ACRES -- Acres
    DUT_HECTARES -- Hectares
UT_Volume -- Volume
    DUT_CUBIC_YARDS -- Cubic yards
    DUT_CUBIC_FEET -- Cubic feet
    DUT_CUBIC_INCHES -- Cubic inches
    DUT_CUBIC_METERS -- Cubic meters
    DUT_CUBIC_CENTIMETERS -- Cubic centimeters
    DUT_CUBIC_MILLIMETERS -- Cubic millimeters
    DUT_LITERS -- Liters
    DUT_GALLONS_US -- US gallons
UT_Angle -- Angle
    DUT_DECIMAL_DEGREES -- Decimal degrees
    DUT_DEGREES_AND_MINUTES -- Degrees minutes seconds
    DUT_RADIANS -- Radians
    DUT_GRADS -- Grads
UT_Number -- Number
    DUT_GENERAL -- General
    DUT_FIXED -- Fixed
    DUT_CURRENCY -- Currency
    DUT_PERCENTAGE -- Percentage
UT_SheetLength -- Sheet Length
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
    DUT_SQUARE_FEET_PER_FOOT -- Square feet per foot
    DUT_SQUARE_INCHES_PER_FOOT -- Square inches per foot
    DUT_SQUARE_MILLIMETERS_PER_METER -- Square millimeters per meter
    DUT_SQUARE_CENTIMETERS_PER_METER -- Square centimeters per meter
    DUT_SQUARE_METERS_PER_METER -- Square meters per meter
UT_SiteAngle -- Site Angle
    DUT_DECIMAL_DEGREES -- Decimal degrees
    DUT_DEGREES_AND_MINUTES -- Degrees minutes seconds
    DUT_RADIANS -- Radians
    DUT_GRADS -- Grads
UT_HVAC_Density -- Density
    DUT_KILOGRAMS_PER_CUBIC_METER -- Kilograms per cubic meter
    DUT_POUNDS_MASS_PER_CUBIC_FOOT -- Pounds per cubic foot
    DUT_POUNDS_MASS_PER_CUBIC_INCH -- Pounds per cubic inch
UT_HVAC_Energy -- Energy
    DUT_BRITISH_THERMAL_UNITS -- British Thermal Units
    DUT_CALORIES -- Calories
    DUT_KILOCALORIES -- Kilocalories
    DUT_JOULES -- Joules
    DUT_KILOWATT_HOURS -- Kilowatt hours
    DUT_THERMS -- Therms
UT_HVAC_Friction -- Friction
    DUT_INCHES_OF_WATER_PER_100FT -- Inches of water (60 °F) per 100 feet
    DUT_PASCALS_PER_METER -- Pascals per meter
UT_HVAC_Power -- Power
    DUT_WATTS -- Watts
    DUT_KILOWATTS -- Kilowatts
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- BTU (British Thermal Units) per second
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- BTU (British Thermal Units) per hour
    DUT_CALORIES_PER_SECOND -- Calories per second
    DUT_KILOCALORIES_PER_SECOND -- Kilocalories per second
UT_HVAC_Power_Density -- Power Density
    DUT_WATTS_PER_SQUARE_FOOT -- Watts per square foot
    DUT_WATTS_PER_SQUARE_METER -- Watts per square meter
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT -- BTU (British Thermal Units) per hour square foot
UT_HVAC_Pressure -- Pressure
    DUT_INCHES_OF_WATER -- Inches of water (60 °F)
    DUT_PASCALS -- Pascals
    DUT_KILOPASCALS -- Kilopascals
    DUT_MEGAPASCALS -- Megapascals
    DUT_POUNDS_FORCE_PER_SQUARE_INCH -- Pounds per square inch
    DUT_INCHES_OF_MERCURY -- Inches of mercury (32 °F)
    DUT_MILLIMETERS_OF_MERCURY -- Millimeters of mercury
    DUT_ATMOSPHERES -- Atmospheres
    DUT_BARS -- Bars
UT_HVAC_Temperature -- Temperature
    DUT_FAHRENHEIT -- Fahrenheit
    DUT_CELSIUS -- Celsius
    DUT_KELVIN -- Kelvin
    DUT_RANKINE -- Rankine
UT_HVAC_Velocity -- Velocity
    DUT_FEET_PER_MINUTE -- Feet per minute
    DUT_METERS_PER_SECOND -- Meters per second
    DUT_CENTIMETERS_PER_MINUTE -- Centimeters per minute
UT_HVAC_Airflow -- Air Flow
    DUT_CUBIC_FEET_PER_MINUTE -- Cubic feet per minute
    DUT_LITERS_PER_SECOND -- Liters per second
    DUT_CUBIC_METERS_PER_SECOND -- Cubic meters per second
    DUT_CUBIC_METERS_PER_HOUR -- Cubic meters per hour
    DUT_GALLONS_US_PER_MINUTE -- US gallons per minute
    DUT_GALLONS_US_PER_HOUR -- US gallons per hour
UT_HVAC_DuctSize -- Duct Size
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_HVAC_CrossSection -- Cross Section
    DUT_SQUARE_FEET -- Square feet
    DUT_SQUARE_INCHES -- Square inches
    DUT_SQUARE_METERS -- Square meters
    DUT_SQUARE_CENTIMETERS -- Square centimeters
    DUT_SQUARE_MILLIMETERS -- Square millimeters
    DUT_ACRES -- Acres
    DUT_HECTARES -- Hectares
UT_HVAC_HeatGain -- Heat Gain
    DUT_WATTS -- Watts
    DUT_KILOWATTS -- Kilowatts
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- BTU (British Thermal Units) per second
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- BTU (British Thermal Units) per hour
    DUT_CALORIES_PER_SECOND -- Calories per second
    DUT_KILOCALORIES_PER_SECOND -- Kilocalories per second
UT_Electrical_Current -- Current
    DUT_AMPERES -- Amperes
    DUT_KILOAMPERES -- Kiloamperes
    DUT_MILLIAMPERES -- Milliamperes
UT_Electrical_Potential -- Electrical Potential
    DUT_VOLTS -- Volts
    DUT_KILOVOLTS -- Kilovolts
    DUT_MILLIVOLTS -- Millivolts
UT_Electrical_Frequency -- Frequency
    DUT_HERTZ -- Hertz
    DUT_CYCLES_PER_SECOND -- Cycles per second
    DUT_CUBIC_FEET_PER_MINUTE_CUBIC_FOOT -- Cubic feet per minute cubic foot
    DUT_LITERS_PER_SECOND_CUBIC_METER -- Liters per second cubic meter
UT_Electrical_Illuminance -- Illuminance
    DUT_LUX -- Lux
    DUT_FOOTCANDLES -- Footcandles
UT_Electrical_Luminous_Flux -- Luminous Flux
    DUT_LUMENS -- Lumens
UT_Electrical_Power -- Power
    DUT_WATTS -- Watts
    DUT_KILOWATTS -- Kilowatts
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- BTU (British Thermal Units) per second
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- BTU (British Thermal Units) per hour
    DUT_CALORIES_PER_SECOND -- Calories per second
    DUT_KILOCALORIES_PER_SECOND -- Kilocalories per second
    DUT_VOLT_AMPERES -- Volt-amperes
    DUT_KILOVOLT_AMPERES -- Kilovolt-amperes
    DUT_HORSEPOWER -- Horsepower
UT_HVAC_Roughness -- Roughness
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Force -- Force
    DUT_NEWTONS -- Newtons
    DUT_DECANEWTONS -- Decanewtons
    DUT_KILONEWTONS -- Kilonewtons
    DUT_MEGANEWTONS -- Meganewtons
    DUT_KIPS -- Kips
    DUT_KILOGRAMS_FORCE -- Kilograms force
    DUT_TONNES_FORCE -- Tonnes force
    DUT_POUNDS_FORCE -- Pounds
UT_LinearForce -- Linear Force
    DUT_NEWTONS_PER_METER -- Newtons per meter
    DUT_DECANEWTONS_PER_METER -- Decanewtons per meter
    DUT_KILONEWTONS_PER_METER -- Kilonewtons per meter
    DUT_MEGANEWTONS_PER_METER -- Meganewtons per meter
    DUT_KIPS_PER_FOOT -- Kips per foot
    DUT_KILOGRAMS_FORCE_PER_METER -- Kilograms force per meter
    DUT_TONNES_FORCE_PER_METER -- Tonnes force per meter
    DUT_POUNDS_FORCE_PER_FOOT -- Pounds per foot
    DUT_KIPS_PER_INCH -- Kips per inch
UT_AreaForce -- Area Force
    DUT_NEWTONS_PER_SQUARE_METER -- Newtons per square meter
    DUT_DECANEWTONS_PER_SQUARE_METER -- Decanewtons per square meter
    DUT_KILONEWTONS_PER_SQUARE_METER -- Kilonewtons per square meter
    DUT_MEGANEWTONS_PER_SQUARE_METER -- Meganewtons per square meter
    DUT_KIPS_PER_SQUARE_FOOT -- Kips per square foot
    DUT_KILOGRAMS_FORCE_PER_SQUARE_METER -- Kilograms force per square meter
    DUT_TONNES_FORCE_PER_SQUARE_METER -- Tonnes force per square meter
    DUT_POUNDS_FORCE_PER_SQUARE_FOOT -- Pounds per square foot
UT_Moment -- Moment
    DUT_NEWTON_METERS -- Newton-meters
    DUT_DECANEWTON_METERS -- Decanewton-meters
    DUT_KILONEWTON_METERS -- Kilonewton-meters
    DUT_MEGANEWTON_METERS -- Meganewton-meters
    DUT_KIP_FEET -- Kip-feet
    DUT_KILOGRAM_FORCE_METERS -- Kilogram force-meters
    DUT_TONNE_FORCE_METERS -- Tonne force-meters
    DUT_POUND_FORCE_FEET -- Pound-feet
UT_ForceScale -- Force Scale
    DUT_METERS_PER_KILONEWTON -- Meters per kilonewton
    DUT_FEET_PER_KIP -- Feet per kip
UT_LinearForceScale -- Linear Force Scale
    DUT_SQUARE_METERS_PER_KILONEWTON -- Square meters per kilonewton
    DUT_SQUARE_FEET_PER_KIP -- Square feet per kip
    DUT_CUBIC_FEET_PER_MINUTE_TON_OF_REFRIGERATION -- Cubic meters per minute tons of refrigeration
    DUT_LITERS_PER_SECOND_KILOWATTS -- Liters per second kilowatts
UT_AreaForceScale -- Area Force Scale
    DUT_CUBIC_METERS_PER_KILONEWTON -- Cubic meters per kilonewton
    DUT_CUBIC_FEET_PER_KIP -- Cubic feet per kip
UT_MomentScale -- Moment Scale
    DUT_INV_KILONEWTONS -- Inverse kilonewtons
    DUT_INV_KIPS -- Inverse kips
UT_Electrical_Apparent_Power -- Apparent Power
    DUT_WATTS -- Watts
    DUT_KILOWATTS -- Kilowatts
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- BTU (British Thermal Units) per second
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- BTU (British Thermal Units) per hour
    DUT_CALORIES_PER_SECOND -- Calories per second
    DUT_KILOCALORIES_PER_SECOND -- Kilocalories per second
    DUT_VOLT_AMPERES -- Volt-amperes
    DUT_KILOVOLT_AMPERES -- Kilovolt-amperes
    DUT_HORSEPOWER -- Horsepower
UT_Electrical_Power_Density -- Power Density
    DUT_WATTS_PER_SQUARE_FOOT -- Watts per square foot
    DUT_WATTS_PER_SQUARE_METER -- Watts per square meter
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT -- BTU (British Thermal Units) per hour square foot
UT_Piping_Density -- Density
    DUT_KILOGRAMS_PER_CUBIC_METER -- Kilograms per cubic meter
    DUT_POUNDS_MASS_PER_CUBIC_FOOT -- Pounds per cubic foot
    DUT_POUNDS_MASS_PER_CUBIC_INCH -- Pounds per cubic inch
UT_Piping_Flow -- Flow
    DUT_LITERS_PER_SECOND -- Liters per second
    DUT_CUBIC_METERS_PER_SECOND -- Cubic meters per second
    DUT_CUBIC_METERS_PER_HOUR -- Cubic meters per hour
    DUT_GALLONS_US_PER_MINUTE -- US gallons per minute
    DUT_GALLONS_US_PER_HOUR -- US gallons per hour
UT_Piping_Friction -- Friction
    DUT_PASCALS_PER_METER -- Pascals per meter
    DUT_FEET_OF_WATER_PER_100FT -- Feet of water (39.2 °F) per 100 feet
UT_Piping_Pressure -- Pressure
    DUT_PASCALS -- Pascals
    DUT_KILOPASCALS -- Kilopascals
    DUT_MEGAPASCALS -- Megapascals
    DUT_POUNDS_FORCE_PER_SQUARE_INCH -- Pounds per square inch
    DUT_INCHES_OF_MERCURY -- Inches of mercury (32 °F)
    DUT_MILLIMETERS_OF_MERCURY -- Millimeters of mercury
    DUT_ATMOSPHERES -- Atmospheres
    DUT_BARS -- Bars
    DUT_FEET_OF_WATER -- Feet of water (39.2 °F)
UT_Piping_Temperature -- Temperature
    DUT_FAHRENHEIT -- Fahrenheit
    DUT_CELSIUS -- Celsius
    DUT_KELVIN -- Kelvin
    DUT_RANKINE -- Rankine
UT_Piping_Velocity -- Velocity
    DUT_METERS_PER_SECOND -- Meters per second
    DUT_FEET_PER_SECOND -- Feet per second
UT_Piping_Viscosity -- Viscosity
    DUT_PASCAL_SECONDS -- Pascal seconds
    DUT_POUNDS_MASS_PER_FOOT_SECOND -- Pounds per foot second
    DUT_CENTIPOISES -- Centipoises
    DUT_POUNDS_MASS_PER_FOOT_HOUR -- Pounds per foot hour
UT_PipeSize -- Pipe Size
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Piping_Roughness -- Roughness
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Stress -- Stress
    DUT_PASCALS -- Pascals
    DUT_KILOPASCALS -- Kilopascals
    DUT_MEGAPASCALS -- Megapascals
    DUT_POUNDS_FORCE_PER_SQUARE_INCH -- Pounds per square inch
    DUT_BARS -- Bars
    DUT_NEWTONS_PER_SQUARE_METER -- Newtons per square meter
    DUT_DECANEWTONS_PER_SQUARE_METER -- Decanewtons per square meter
    DUT_KILONEWTONS_PER_SQUARE_METER -- Kilonewtons per square meter
    DUT_MEGANEWTONS_PER_SQUARE_METER -- Meganewtons per square meter
    DUT_KILONEWTONS_PER_SQUARE_CENTIMETER -- Kilonewtons per square centimeter
    DUT_NEWTONS_PER_SQUARE_MILLIMETER -- Newtons per square millimeter
    DUT_KILONEWTONS_PER_SQUARE_MILLIMETER -- Kilonewtons per square millimeter
    DUT_KIPS_PER_SQUARE_FOOT -- Kips per square foot
    DUT_KILOGRAMS_FORCE_PER_SQUARE_METER -- Kilograms force per square meter
    DUT_TONNES_FORCE_PER_SQUARE_METER -- Tonnes force per square meter
    DUT_POUNDS_FORCE_PER_SQUARE_FOOT -- Pounds per square foot
    DUT_KIPS_PER_SQUARE_INCH -- Kips per square inch
UT_UnitWeight -- Unit Weight
    DUT_POUNDS_FORCE_PER_CUBIC_FOOT -- Pounds per cubic foot
    DUT_KIPS_PER_CUBIC_INCH -- Kips per cubic inch
    DUT_KILONEWTONS_PER_CUBIC_METER -- Kilonewtons per cubic meter
UT_ThermalExpansion -- Thermal Expansion Coefficient
    DUT_INV_FAHRENHEIT -- Inverse degrees Fahrenheit
    DUT_MICROINCHES_PER_INCH_FAHRENHEIT -- Microinches per inch Fahrenheit
    DUT_INV_CELSIUS -- Inverse degrees Celsius
    DUT_MICROMETERS_PER_METER_CELSIUS -- Micrometers per meter Celsius
UT_LinearMoment -- Linear Moment
    DUT_NEWTON_METERS_PER_METER -- Newton-meters per meter
    DUT_DECANEWTON_METERS_PER_METER -- Decanewton-meters per meter
    DUT_KILONEWTON_METERS_PER_METER -- Kilonewton-meters per meter
    DUT_MEGANEWTON_METERS_PER_METER -- Meganewton-meters per meter
    DUT_KIP_FEET_PER_FOOT -- Kip-feet per foot
    DUT_KILOGRAM_FORCE_METERS_PER_METER -- Kilogram force-meters per meter
    DUT_TONNE_FORCE_METERS_PER_METER -- Tonne force-meters per meter
    DUT_POUND_FORCE_FEET_PER_FOOT -- Pound-feet per foot
UT_LinearMomentScale -- Linear Moment Scale
    DUT_METERS_PER_KILONEWTON -- Meters per kilonewton
    DUT_FEET_PER_KIP -- Feet per kip
UT_ForcePerLength -- Point Spring Coefficient
    DUT_NEWTONS_PER_METER -- Newtons per meter
    DUT_DECANEWTONS_PER_METER -- Decanewtons per meter
    DUT_KILONEWTONS_PER_METER -- Kilonewtons per meter
    DUT_MEGANEWTONS_PER_METER -- Meganewtons per meter
    DUT_KIPS_PER_FOOT -- Kips per foot
    DUT_KILOGRAMS_FORCE_PER_METER -- Kilograms force per meter
    DUT_TONNES_FORCE_PER_METER -- Tonnes force per meter
    DUT_POUNDS_FORCE_PER_FOOT -- Pounds per foot
    DUT_KIPS_PER_INCH -- Kips per inch
UT_ForceLengthPerAngle -- Rotational Point Spring Coefficient
    DUT_KIP_FEET_PER_DEGREE -- Kip feet per degree
    DUT_KILONEWTON_METERS_PER_DEGREE -- Kilonewton meters per degree
UT_LinearForcePerLength -- Line Spring Coefficient
    DUT_INCHES_OF_WATER -- Inches of water (60 °F)
    DUT_PASCALS -- Pascals
    DUT_KILOPASCALS -- Kilopascals
    DUT_MEGAPASCALS -- Megapascals
    DUT_POUNDS_FORCE_PER_SQUARE_INCH -- Pounds per square inch
    DUT_INCHES_OF_MERCURY -- Inches of mercury (32 °F)
    DUT_MILLIMETERS_OF_MERCURY -- Millimeters of mercury
    DUT_ATMOSPHERES -- Atmospheres
    DUT_BARS -- Bars
    DUT_NEWTONS_PER_SQUARE_METER -- Newtons per square meter
    DUT_DECANEWTONS_PER_SQUARE_METER -- Decanewtons per square meter
    DUT_KILONEWTONS_PER_SQUARE_METER -- Kilonewtons per square meter
    DUT_MEGANEWTONS_PER_SQUARE_METER -- Meganewtons per square meter
    DUT_KILONEWTONS_PER_SQUARE_CENTIMETER -- Kilonewtons per square centimeter
    DUT_NEWTONS_PER_SQUARE_MILLIMETER -- Newtons per square millimeter
    DUT_KILONEWTONS_PER_SQUARE_MILLIMETER -- Kilonewtons per square millimeter
    DUT_KIPS_PER_SQUARE_FOOT -- Kips per square foot
    DUT_KILOGRAMS_FORCE_PER_SQUARE_METER -- Kilograms force per square meter
    DUT_TONNES_FORCE_PER_SQUARE_METER -- Tonnes force per square meter
    DUT_POUNDS_FORCE_PER_SQUARE_FOOT -- Pounds per square foot
    DUT_FEET_OF_WATER -- Feet of water (39.2 °F)
    DUT_KIPS_PER_SQUARE_INCH -- Kips per square inch
UT_LinearForceLengthPerAngle -- Rotational Line Spring Coefficient
    DUT_KIP_FEET_PER_DEGREE_PER_FOOT -- Kip feet per degree per foot
    DUT_KILONEWTON_METERS_PER_DEGREE_PER_METER -- Kilonewton meters per degree per meter
UT_AreaForcePerLength -- Area Spring Coefficient
    DUT_INCHES_OF_WATER_PER_100FT -- Inches of water (60 °F) per 100 feet
    DUT_PASCALS_PER_METER -- Pascals per meter
    DUT_FEET_OF_WATER_PER_100FT -- Feet of water (39.2 °F) per 100 feet
    DUT_POUNDS_FORCE_PER_CUBIC_FOOT -- Pounds per cubic foot
    DUT_KIPS_PER_CUBIC_INCH -- Kips per cubic inch
    DUT_KILONEWTONS_PER_CUBIC_METER -- Kilonewtons per cubic meter
    DUT_KIPS_PER_CUBIC_FOOT -- Kips per cubic foot
UT_Piping_Volume -- Volume
    DUT_CUBIC_YARDS -- Cubic yards
    DUT_CUBIC_FEET -- Cubic feet
    DUT_CUBIC_INCHES -- Cubic inches
    DUT_CUBIC_METERS -- Cubic meters
    DUT_CUBIC_CENTIMETERS -- Cubic centimeters
    DUT_CUBIC_MILLIMETERS -- Cubic millimeters
    DUT_LITERS -- Liters
    DUT_GALLONS_US -- US gallons
UT_HVAC_Viscosity -- Viscosity
    DUT_PASCAL_SECONDS -- Pascal seconds
    DUT_POUNDS_MASS_PER_FOOT_SECOND -- Pounds per foot second
    DUT_CENTIPOISES -- Centipoises
    DUT_POUNDS_MASS_PER_FOOT_HOUR -- Pounds per foot hour
UT_HVAC_CoefficientOfHeatTransfer -- Coefficient of Heat Transfer
    DUT_WATTS_PER_SQUARE_METER_KELVIN -- Watts per square meter kelvin
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT_FAHRENHEIT -- BTU (British Thermal Units) per hour square foot degree Fahrenheit
UT_HVAC_Airflow_Density -- Air Flow Density
    DUT_CUBIC_FEET_PER_MINUTE_SQUARE_FOOT -- Cubic feet per minute square foot
    DUT_LITERS_PER_SECOND_SQUARE_METER -- Liters per second square meter
UT_Slope -- Slope
    DUT_1_RATIO -- 1 : Ratio
    DUT_RATIO_12 -- Ratio : 12
    DUT_RATIO_10 -- Ratio : 10
    DUT_RISE_OVER_INCHES -- Rise / 12"
    DUT_RISE_OVER_FOOT -- Rise / 1' - 0"
    DUT_RISE_OVER_MMS -- Rise / 1000 mm
    DUT_SLOPE_DEGREES -- Decimal degrees
    DUT_PERCENTAGE -- Percentage
UT_HVAC_Cooling_Load -- Cooling Load
    DUT_WATTS -- Watts
    DUT_KILOWATTS -- Kilowatts
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- BTU (British Thermal Units) per second
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- BTU (British Thermal Units) per hour
    DUT_TON_OF_REFRIGERATION -- Tons of refrigeration (12 000 BTU (British Thermal Units) per hour)
UT_HVAC_Cooling_Load_Divided_By_Area -- Cooling Load divided by Area
    DUT_WATTS_PER_SQUARE_FOOT -- Watts per square foot
    DUT_WATTS_PER_SQUARE_METER -- Watts per square meter
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT -- BTU (British Thermal Units) per hour square foot
UT_HVAC_Cooling_Load_Divided_By_Volume -- Cooling Load divided by Volume
    DUT_WATTS_PER_CUBIC_FOOT -- Watts per cubic foot
    DUT_WATTS_PER_CUBIC_METER -- Watts per cubic meter
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_CUBIC_FOOT -- BTU (British Thermal Units) per hour cubic foot
UT_HVAC_Heating_Load -- Heating Load
    DUT_WATTS -- Watts
    DUT_KILOWATTS -- Kilowatts
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- BTU (British Thermal Units) per second
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- BTU (British Thermal Units) per hour
UT_HVAC_Heating_Load_Divided_By_Area -- Heating Load divided by Area
    DUT_WATTS_PER_SQUARE_FOOT -- Watts per square foot
    DUT_WATTS_PER_SQUARE_METER -- Watts per square meter
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT -- BTU (British Thermal Units) per hour square foot
UT_HVAC_Heating_Load_Divided_By_Volume -- Heating Load divided by Volume
    DUT_WATTS_PER_CUBIC_FOOT -- Watts per cubic foot
    DUT_WATTS_PER_CUBIC_METER -- Watts per cubic meter
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_CUBIC_FOOT -- BTU (British Thermal Units) per hour cubic foot
UT_HVAC_Airflow_Divided_By_Volume -- Air Flow divided by Volume
    DUT_CUBIC_FEET_PER_MINUTE_CUBIC_FOOT -- Cubic feet per minute cubic foot
    DUT_LITERS_PER_SECOND_CUBIC_METER -- Liters per second cubic meter
UT_HVAC_Airflow_Divided_By_Cooling_Load -- Air Flow divided by Cooling Load
    DUT_CUBIC_FEET_PER_MINUTE_TON_OF_REFRIGERATION -- Cubic meters per minute tons of refrigeration
    DUT_LITERS_PER_SECOND_KILOWATTS -- Liters per second kilowatts
UT_HVAC_Area_Divided_By_Cooling_Load -- Area divided by Cooling Load
    DUT_SQUARE_FEET_PER_TON_OF_REFRIGERATION -- Square feet per tons of refrigeration
    DUT_SQUARE_METERS_PER_KILOWATTS -- Square meters per kilowatts
UT_WireSize -- Wire Diameter
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_HVAC_Slope -- Slope
    DUT_1_RATIO -- 1 : Ratio
    DUT_RATIO_12 -- Ratio : 12
    DUT_RATIO_10 -- Ratio : 10
    DUT_RISE_OVER_INCHES -- Rise / 12"
    DUT_RISE_OVER_FOOT -- Rise / 1' - 0"
    DUT_RISE_OVER_MMS -- Rise / 1000 mm
    DUT_SLOPE_DEGREES -- Decimal degrees
    DUT_PERCENTAGE -- Percentage
    DUT_PER_MILLE -- Per mille
UT_Piping_Slope -- Slope
    DUT_1_RATIO -- 1 : Ratio
    DUT_RATIO_12 -- Ratio : 12
    DUT_RATIO_10 -- Ratio : 10
    DUT_RISE_OVER_INCHES -- Rise / 12"
    DUT_RISE_OVER_120_INCHES -- Rise / 120"
    DUT_RISE_OVER_FOOT -- Rise / 1' - 0"
    DUT_RISE_OVER_10_FEET -- Rise / 10'
    DUT_RISE_OVER_MMS -- Rise / 1000 mm
    DUT_SLOPE_DEGREES -- Decimal degrees
    DUT_PERCENTAGE -- Percentage
    DUT_PER_MILLE -- Per mille
UT_Currency -- Currency
    DUT_CURRENCY -- Currency
UT_Electrical_Efficacy -- Efficacy
    DUT_LUMENS_PER_WATT -- Lumens per watt
UT_Electrical_Wattage -- Wattage
    DUT_WATTS -- Watts
UT_Color_Temperature -- Color Temperature
    DUT_KELVIN -- Kelvin
UT_DecSheetLength -- Sheet Length
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
    DUT_SQUARE_FEET_PER_FOOT -- Square feet per foot
    DUT_SQUARE_INCHES_PER_FOOT -- Square inches per foot
    DUT_SQUARE_MILLIMETERS_PER_METER -- Square millimeters per meter
    DUT_SQUARE_CENTIMETERS_PER_METER -- Square centimeters per meter
    DUT_SQUARE_METERS_PER_METER -- Square meters per meter
UT_Electrical_Luminous_Intensity -- Luminous Intensity
    DUT_CANDELAS -- Candelas
UT_Electrical_Luminance -- Luminance
    DUT_FOOTLAMBERTS -- Footlamberts
    DUT_CANDELAS_PER_SQUARE_METER -- Candelas per square meter
UT_HVAC_Area_Divided_By_Heating_Load -- Area divided by Heating Load
    DUT_SQUARE_METERS_PER_KILOWATTS -- Square meters per kilowatts
    DUT_SQUARE_FEET_PER_THOUSAND_BRITISH_THERMAL_UNITS_PER_HOUR -- Square feet per thousand BTU (British Thermal Units) per hour
UT_HVAC_Factor -- Factor
    DUT_FIXED -- Fixed
    DUT_PERCENTAGE -- Percentage
UT_Electrical_Temperature -- Temperature
    DUT_FAHRENHEIT -- Fahrenheit
    DUT_CELSIUS -- Celsius
    DUT_KELVIN -- Kelvin
    DUT_RANKINE -- Rankine
UT_Electrical_CableTraySize -- Cable Tray Size
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Electrical_ConduitSize -- Conduit Size
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Reinforcement_Volume -- Reinforcement Volume
    DUT_CUBIC_FEET -- Cubic feet
    DUT_CUBIC_INCHES -- Cubic inches
    DUT_CUBIC_METERS -- Cubic meters
    DUT_CUBIC_CENTIMETERS -- Cubic centimeters
UT_Reinforcement_Length -- Reinforcement Length
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Electrical_Demand_Factor -- Demand Factor
    DUT_FIXED -- Fixed
    DUT_PERCENTAGE -- Percentage
UT_HVAC_DuctInsulationThickness -- Duct Insulation Thickness
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_HVAC_DuctLiningThickness -- Duct Lining Thickness
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_PipeInsulationThickness -- Pipe Insulation Thickness
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_DECIMETERS -- Decimeters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_HVAC_ThermalResistance -- Thermal Resistance
    DUT_SQUARE_METER_KELVIN_PER_WATT -- Square meter kelvin per watt
    DUT_HOUR_SQUARE_FOOT_FAHRENHEIT_PER_BRITISH_THERMAL_UNIT -- Hour square foot degree Fahrenheit per BTU (British Thermal Unit)
UT_HVAC_ThermalMass -- Thermal Mass
    DUT_BRITISH_THERMAL_UNIT_PER_FAHRENHEIT -- BTU per degree Fahrenheit
    DUT_JOULES_PER_KELVIN -- Joules per degree Kelvin
    DUT_KILOJOULES_PER_KELVIN -- Kilojoules per degree Kelvin
UT_Acceleration -- Acceleration
    DUT_METERS_PER_SECOND_SQUARED -- Meters per second squared
    DUT_KILOMETERS_PER_SECOND_SQUARED -- Kilometers per second squared
    DUT_INCHES_PER_SECOND_SQUARED -- Inches per second squared
    DUT_FEET_PER_SECOND_SQUARED -- Feet per second squared
    DUT_MILES_PER_SECOND_SQUARED -- Miles per second squared
UT_Bar_Diameter -- Bar Diameter
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
UT_Crack_Width -- Crack Width
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Displacement_Deflection -- Displacement/Deflection
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Energy -- Energy
    DUT_JOULES -- Joules
    DUT_NEWTON_METERS -- Newton-meters
    DUT_KILOGRAM_FORCE_METERS -- Kilogram force-meters
    DUT_POUND_FORCE_FEET -- Pound-feet
    DUT_KILOJOULES -- Kilojoules
UT_Structural_Frequency -- Frequency
    DUT_HERTZ -- Hertz
UT_Mass -- Mass
    DUT_KILOGRAMS_MASS -- Kilograms
    DUT_TONNES_MASS -- Tonnes
    DUT_POUNDS_MASS -- Pounds
UT_Mass_per_Unit_Length -- Mass per Unit Length
    DUT_KILOGRAMS_MASS_PER_METER -- Kilograms per meter
    DUT_POUNDS_MASS_PER_FOOT -- Pounds per foot
UT_Moment_of_Inertia -- Moment of Inertia
    DUT_FEET_TO_THE_FOURTH_POWER -- Feet to the fourth power
    DUT_INCHES_TO_THE_FOURTH_POWER -- Inches to the fourth power
    DUT_MILLIMETERS_TO_THE_FOURTH_POWER -- Millimeters to the fourth power
    DUT_CENTIMETERS_TO_THE_FOURTH_POWER -- Centimeters to the fourth power
    DUT_METERS_TO_THE_FOURTH_POWER -- Meters to the fourth power
UT_Surface_Area -- Surface Area per Unit Length
    DUT_SQUARE_FEET_PER_FOOT -- Square feet per foot
    DUT_SQUARE_METERS_PER_METER -- Square meters per meter
UT_Period -- Period
    DUT_MILISECONDS -- Milliseconds
    DUT_SECONDS -- Seconds
    DUT_MINUTES -- Minutes
    DUT_HOURS -- Hours
UT_Pulsation -- Pulsation
    DUT_RADIANS_PER_SECOND -- Radians per second
UT_Reinforcement_Area -- Reinforcement Area
    DUT_SQUARE_FEET -- Square feet
    DUT_SQUARE_INCHES -- Square inches
    DUT_SQUARE_METERS -- Square meters
    DUT_SQUARE_CENTIMETERS -- Square centimeters
    DUT_SQUARE_MILLIMETERS -- Square millimeters
UT_Reinforcement_Area_per_Unit_Length -- Reinforcement Area per Unit Length
    DUT_SQUARE_FEET_PER_FOOT -- Square feet per foot
    DUT_SQUARE_INCHES_PER_FOOT -- Square inches per foot
    DUT_SQUARE_MILLIMETERS_PER_METER -- Square millimeters per meter
    DUT_SQUARE_CENTIMETERS_PER_METER -- Square centimeters per meter
    DUT_SQUARE_METERS_PER_METER -- Square meters per meter
UT_Reinforcement_Cover -- Reinforcement Cover
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
UT_Reinforcement_Spacing -- Reinforcement Spacing
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Rotation -- Rotation
    DUT_DECIMAL_DEGREES -- Decimal degrees
    DUT_DEGREES_AND_MINUTES -- Degrees minutes seconds
    DUT_RADIANS -- Radians
    DUT_GRADS -- Grads
UT_Section_Area -- Section Area
    DUT_SQUARE_FEET -- Square feet
    DUT_SQUARE_INCHES -- Square inches
    DUT_SQUARE_METERS -- Square meters
    DUT_SQUARE_CENTIMETERS -- Square centimeters
    DUT_SQUARE_MILLIMETERS -- Square millimeters
UT_Section_Dimension -- Section Dimension
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Section_Modulus -- Section Modulus
    DUT_CUBIC_FEET -- Cubic feet
    DUT_CUBIC_INCHES -- Cubic inches
    DUT_CUBIC_METERS -- Cubic meters
    DUT_CUBIC_CENTIMETERS -- Cubic centimeters
    DUT_CUBIC_MILLIMETERS -- Cubic millimeters
UT_Section_Property -- Section Property
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_METERS -- Meters
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
UT_Structural_Velocity -- Velocity
    DUT_FEET_PER_MINUTE -- Feet per minute
    DUT_METERS_PER_SECOND -- Meters per second
    DUT_FEET_PER_SECOND -- Feet per second
    DUT_KILOMETERS_PER_HOUR -- Kilometers per hour
    DUT_MILES_PER_HOUR -- Miles per hour
UT_Warping_Constant -- Warping Constant
    DUT_FEET_TO_THE_SIXTH_POWER -- Feet to the sixth power
    DUT_INCHES_TO_THE_SIXTH_POWER -- Inches to the sixth power
    DUT_MILLIMETERS_TO_THE_SIXTH_POWER -- Millimeters to the sixth power
    DUT_CENTIMETERS_TO_THE_SIXTH_POWER -- Centimeters to the sixth power
    DUT_METERS_TO_THE_SIXTH_POWER -- Meters to the sixth power
UT_Weight -- Weight
    DUT_NEWTONS -- Newtons
    DUT_DECANEWTONS -- Decanewtons
    DUT_KILONEWTONS -- Kilonewtons
    DUT_MEGANEWTONS -- Meganewtons
    DUT_KIPS -- Kips
    DUT_KILOGRAMS_FORCE -- Kilograms force
    DUT_TONNES_FORCE -- Tonnes force
    DUT_POUNDS_FORCE -- Pounds
UT_Weight_per_Unit_Length -- Weight per Unit Length
    DUT_NEWTONS_PER_METER -- Newtons per meter
    DUT_DECANEWTONS_PER_METER -- Decanewtons per meter
    DUT_KILONEWTONS_PER_METER -- Kilonewtons per meter
    DUT_MEGANEWTONS_PER_METER -- Meganewtons per meter
    DUT_KIPS_PER_FOOT -- Kips per foot
    DUT_KILOGRAMS_FORCE_PER_METER -- Kilograms force per meter
    DUT_TONNES_FORCE_PER_METER -- Tonnes force per meter
    DUT_POUNDS_FORCE_PER_FOOT -- Pounds per foot
    DUT_KIPS_PER_INCH -- Kips per inch
UT_HVAC_ThermalConductivity -- Thermal Conductivity
    DUT_WATTS_PER_METER_KELVIN -- Watts per meter kelvin
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_FOOT_FAHRENHEIT -- BTU (British Thermal Units) per hour foot degree Fahrenheit
UT_HVAC_SpecificHeat -- Specific Heat
    DUT_JOULES_PER_GRAM_CELSIUS -- Joules per gram Celsius
    DUT_JOULES_PER_KILOGRAM_CELSIUS -- Joules per kilogram Celsius
    DUT_BRITISH_THERMAL_UNITS_PER_POUND_FAHRENHEIT -- BTU (British Thermal Units) per pound Fahrenheit
UT_HVAC_SpecificHeatOfVaporization -- Specific Heat of Vaporization
    DUT_JOULES_PER_GRAM -- Joules per gram
    DUT_BRITISH_THERMAL_UNITS_PER_POUND -- BTU (British Thermal Units) per pound
UT_HVAC_Permeability -- Permeability
    DUT_NANOGRAMS_PER_PASCAL_SECOND_SQUARE_METER -- Nanograms per pascal second square meter
    DUT_GRAINS_PER_HOUR_SQUARE_FOOT_INCH_MERCURY -- Grains per hour square foot inch mercury
UT_Electrical_Resistivity -- Electrical Resistivity
    DUT_OHM_METERS -- Ohm meters
UT_MassDensity -- Mass Density
    DUT_KILOGRAMS_PER_CUBIC_METER -- Kilograms per cubic meter
    DUT_POUNDS_MASS_PER_CUBIC_FOOT -- Pounds per cubic foot
UT_MassPerUnitArea -- Mass per Unit Area
    DUT_POUNDS_MASS_PER_SQUARE_FOOT -- Pounds per square foot
    DUT_KILOGRAMS_MASS_PER_SQUARE_METER -- Kilograms per square meter
UT_Pipe_Dimension -- Pipe Dimension
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
    DUT_CENTIMETERS -- Centimeters
    DUT_MILLIMETERS -- Millimeters
UT_PipeMass -- Mass
    DUT_KILOGRAMS_MASS -- Kilograms
    DUT_TONNES_MASS -- Tonnes
    DUT_POUNDS_MASS -- Pounds
UT_PipeMassPerUnitLength -- Mass per Unit Length
    DUT_KILOGRAMS_MASS_PER_METER -- Kilograms per meter
    DUT_POUNDS_MASS_PER_FOOT -- Pounds per foot

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit Units .NET API: Catalog Unit Types (UnitType Enum Values)

$
0
0

Revit .NET has provided the Units API since version 2014. In this series of posts, we are going to explore the Revit Units .NET API and provide sample code and analysis as usual.

Let’s catalog all unit types (the API UnitType enum values).

        public static void CatalogUnitTypes()
        {
            Dictionary<string, List<UnitType>> dictCat2UT = new Dictionary<string, List<UnitType>>();
            foreach (UnitType ut in UnitUtils.GetValidUnitTypes())
            {
                string catalog = UnitUtils.GetTypeCatalogString(ut);
                if (dictCat2UT.ContainsKey(catalog))
                    dictCat2UT[catalog].Add(ut);
                else
                    dictCat2UT.Add(catalog, new List<UnitType> { ut });
            }

            string info = "";
            using (StreamWriter sw = new StreamWriter(@"c:\temp\RevitUnitTypeCatalogs.txt"))
                foreach (KeyValuePair<string, List<UnitType>> entry in dictCat2UT)
                {
                    sw.WriteLine(entry.Key);
                    foreach (UnitType ut in entry.Value)
                    {
                        info = string.Format("\t{0} -- {1}", ut, LabelUtils.GetLabelFor(ut));
                        sw.WriteLine(info);
                    }
                }
        }

    

RevitUnitsAPI.CatalogUnitTypes();


The output may look something as follows:

NUMBER
    UT_Number -- Number
LENGTH
    UT_Length -- Length
AREA
    UT_Area -- Area
VOLUME
    UT_Volume -- Volume
ANGLE
    UT_Angle -- Angle

    UT_SheetLength -- Sheet Length
    UT_DecSheetLength -- Sheet Length
    UT_SiteAngle -- Site Angle
    UT_ForceScale -- Force Scale
    UT_LinearForceScale -- Linear Force Scale
    UT_AreaForceScale -- Area Force Scale
    UT_MomentScale -- Moment Scale
    UT_LinearMomentScale -- Linear Moment Scale
HVAC_DENSITY
    UT_HVAC_Density -- Density
HVAC_ENERGY
    UT_HVAC_Energy -- Energy
HVAC_FRICTION
    UT_HVAC_Friction -- Friction
HVAC_POWER
    UT_HVAC_Power -- Power
HVAC_POWER_DENSITY
    UT_HVAC_Power_Density -- Power Density
HVAC_PRESSURE
    UT_HVAC_Pressure -- Pressure
HVAC_TEMPERATURE
    UT_HVAC_Temperature -- Temperature
HVAC_VELOCITY
    UT_HVAC_Velocity -- Velocity
HVAC_AIR_FLOW
    UT_HVAC_Airflow -- Air Flow
HVAC_DUCT_SIZE
    UT_HVAC_DuctSize -- Duct Size
HVAC_CROSS_SECTION
    UT_HVAC_CrossSection -- Cross Section
HVAC_HEAT_GAIN
    UT_HVAC_HeatGain -- Heat Gain
ELECTRICAL_CURRENT
    UT_Electrical_Current -- Current
ELECTRICAL_POTENTIAL
    UT_Electrical_Potential -- Electrical Potential
ELECTRICAL_FREQUENCY
    UT_Electrical_Frequency -- Frequency
ELECTRICAL_ILLUMINANCE
    UT_Electrical_Illuminance -- Illuminance
ELECTRICAL_LUMINANCE
    UT_Electrical_Luminance -- Luminance
ELECTRICAL_LUMINOUS_FLUX
    UT_Electrical_Luminous_Flux -- Luminous Flux
ELECTRICAL_LUMINOUS_INTENSITY
    UT_Electrical_Luminous_Intensity -- Luminous Intensity
ELECTRICAL_EFFICACY
    UT_Electrical_Efficacy -- Efficacy
ELECTRICAL_WATTAGE
    UT_Electrical_Wattage -- Wattage
COLOR_TEMPERATURE
    UT_Color_Temperature -- Color Temperature
ELECTRICAL_POWER
    UT_Electrical_Power -- Power
HVAC_ROUGHNESS
    UT_HVAC_Roughness -- Roughness
ELECTRICAL_APPARENT_POWER
    UT_Electrical_Apparent_Power -- Apparent Power
ELECTRICAL_POWER_DENSITY
    UT_Electrical_Power_Density -- Power Density
PIPING_DENSITY
    UT_Piping_Density -- Density
PIPING_FLOW
    UT_Piping_Flow -- Flow
PIPING_FRICTION
    UT_Piping_Friction -- Friction
PIPING_PRESSURE
    UT_Piping_Pressure -- Pressure
PIPING_TEMPERATURE
    UT_Piping_Temperature -- Temperature
PIPING_VELOCITY
    UT_Piping_Velocity -- Velocity
PIPING_VISCOSITY
    UT_Piping_Viscosity -- Viscosity
PIPE_SIZE
    UT_PipeSize -- Pipe Size
PIPING_ROUGHNESS
    UT_Piping_Roughness -- Roughness
PIPING_VOLUME
    UT_Piping_Volume -- Volume
HVAC_VISCOSITY
    UT_HVAC_Viscosity -- Viscosity
HVAC_COEFFICIENT_OF_HEAT_TRANSFER
    UT_HVAC_CoefficientOfHeatTransfer -- Coefficient of Heat Transfer
HVAC_THERMAL_RESISTANCE
    UT_HVAC_ThermalResistance -- Thermal Resistance
HVAC_THERMAL_MASS
    UT_HVAC_ThermalMass -- Thermal Mass
HVAC_THERMAL_CONDUCTIVITY
    UT_HVAC_ThermalConductivity -- Thermal Conductivity
HVAC_SPECIFIC_HEAT
    UT_HVAC_SpecificHeat -- Specific Heat
HVAC_SPECIFIC_HEAT_OF_VAPORIZATION
    UT_HVAC_SpecificHeatOfVaporization -- Specific Heat of Vaporization
HVAC_PERMEABILITY
    UT_HVAC_Permeability -- Permeability
ELECTRICAL_RESISTIVITY
    UT_Electrical_Resistivity -- Electrical Resistivity
HVAC_AIRFLOW_DENSITY
    UT_HVAC_Airflow_Density -- Air Flow Density
SLOPE
    UT_Slope -- Slope
HVAC_COOLING_LOAD
    UT_HVAC_Cooling_Load -- Cooling Load
HVAC_HEATING_LOAD
    UT_HVAC_Heating_Load -- Heating Load
HVAC_COOLING_LOAD_DIVIDED_BY_AREA
    UT_HVAC_Cooling_Load_Divided_By_Area -- Cooling Load divided by Area
HVAC_HEATING_LOAD_DIVIDED_BY_AREA
    UT_HVAC_Heating_Load_Divided_By_Area -- Heating Load divided by Area
HVAC_COOLING_LOAD_DIVIDED_BY_VOLUME
    UT_HVAC_Cooling_Load_Divided_By_Volume -- Cooling Load divided by Volume
HVAC_HEATING_LOAD_DIVIDED_BY_VOLUME
    UT_HVAC_Heating_Load_Divided_By_Volume -- Heating Load divided by Volume
HVAC_AIRFLOW_DIVIDED_BY_VOLUME
    UT_HVAC_Airflow_Divided_By_Volume -- Air Flow divided by Volume
HVAC_AIRFLOW_DIVIDED_BY_COOLING_LOAD
    UT_HVAC_Airflow_Divided_By_Cooling_Load -- Air Flow divided by Cooling Load
HVAC_AREA_DIVIDED_BY_COOLING_LOAD
    UT_HVAC_Area_Divided_By_Cooling_Load -- Area divided by Cooling Load
HVAC_AREA_DIVIDED_BY_HEATING_LOAD
    UT_HVAC_Area_Divided_By_Heating_Load -- Area divided by Heating Load
WIRE_SIZE
    UT_WireSize -- Wire Diameter
HVAC_SLOPE
    UT_HVAC_Slope -- Slope
PIPING_SLOPE
    UT_Piping_Slope -- Slope
CURRENCY
    UT_Currency -- Currency
MASS_DENSITY
    UT_MassDensity -- Mass Density
HVAC_FACTOR
    UT_HVAC_Factor -- Factor
ELECTRICAL_TEMPERATURE
    UT_Electrical_Temperature -- Temperature
CABLETRAY_SIZE
    UT_Electrical_CableTraySize -- Cable Tray Size
CONDUIT_SIZE
    UT_Electrical_ConduitSize -- Conduit Size
ELECTRICAL_DEMAND_FACTOR
    UT_Electrical_Demand_Factor -- Demand Factor
HVAC_DUCT_INSULATION_THICKNESS
    UT_HVAC_DuctInsulationThickness -- Duct Insulation Thickness
HVAC_DUCT_LINING_THICKNESS
    UT_HVAC_DuctLiningThickness -- Duct Lining Thickness
PIPE_INSUlATION_THICKNESS
    UT_PipeInsulationThickness -- Pipe Insulation Thickness
FORCE
    UT_Force -- Force
LINEAR_FORCE
    UT_LinearForce -- Linear Force
AREA_FORCE
    UT_AreaForce -- Area Force
MOMENT
    UT_Moment -- Moment
LINEAR_MOMENT
    UT_LinearMoment -- Linear Moment
STRESS
    UT_Stress -- Stress
UNIT_WEIGHT
    UT_UnitWeight -- Unit Weight
WEIGHT
    UT_Weight -- Weight
MASS
    UT_Mass -- Mass
MASS_PER_UNIT_AREA
    UT_MassPerUnitArea -- Mass per Unit Area
THERMAL_EXPANSION_COEFFICIENT
    UT_ThermalExpansion -- Thermal Expansion Coefficient
POINT_SPRING_COEFFICIENT
    UT_ForcePerLength -- Point Spring Coefficient
LINEAR_SPRING_COEFFICIENT
    UT_LinearForcePerLength -- Line Spring Coefficient
AREA_SPRING_COEFFICIENT
    UT_AreaForcePerLength -- Area Spring Coefficient
ROTATIONAL_POINT_SPRING_COEFFICIENT
    UT_ForceLengthPerAngle -- Rotational Point Spring Coefficient
ROTATIONAL_LINEAR_SPRING_COEFFICIENT
    UT_LinearForceLengthPerAngle -- Rotational Line Spring Coefficient
DISPLACEMENT/DEFLECTION
    UT_Displacement_Deflection -- Displacement/Deflection
ROTATION
    UT_Rotation -- Rotation
PERIOD
    UT_Period -- Period
STRUCTURAL_FREQUENCY
    UT_Structural_Frequency -- Frequency
PULSATION
    UT_Pulsation -- Pulsation
VELOCITY
    UT_Structural_Velocity -- Velocity
ACCELERATION
    UT_Acceleration -- Acceleration
ENERGY
    UT_Energy -- Energy
REINFORCEMENT_VOLUME
    UT_Reinforcement_Volume -- Reinforcement Volume
REINFORCEMENT_LENGTH
    UT_Reinforcement_Length -- Reinforcement Length
REINFORCEMENT_AREA
    UT_Reinforcement_Area -- Reinforcement Area
REINFORCEMENT_AREA_PER_UNIT_LENGTH
    UT_Reinforcement_Area_per_Unit_Length -- Reinforcement Area per Unit Length
REINFORCEMENT_SPACING
    UT_Reinforcement_Spacing -- Reinforcement Spacing
REINFORCEMENT_COVER
    UT_Reinforcement_Cover -- Reinforcement Cover
BAR_DIAMETER
    UT_Bar_Diameter -- Bar Diameter
CRACK_WIDTH
    UT_Crack_Width -- Crack Width
SECTION_DIMENSION
    UT_Section_Dimension -- Section Dimension
SECTION_PROPERTY
    UT_Section_Property -- Section Property
SECTION_AREA
    UT_Section_Area -- Section Area
SECTION_MODULUS
    UT_Section_Modulus -- Section Modulus
MOMENT_OF_INERTIA
    UT_Moment_of_Inertia -- Moment of Inertia
WARPING_CONSTANT
    UT_Warping_Constant -- Warping Constant
MASS_PER_UNIT_LENGTH
    UT_Mass_per_Unit_Length -- Mass per Unit Length
WEIGHT_PER_UNIT_LENGTH
    UT_Weight_per_Unit_Length -- Weight per Unit Length
SURFACE_AREA
    UT_Surface_Area -- Surface Area per Unit Length
PIPE_DIMENSION
    UT_Pipe_Dimension -- Pipe Dimension
PIPE_MASS
    UT_PipeMass -- Mass
PIPE_MASS_PER_UNIT_LENGTH
    UT_PipeMassPerUnitLength -- Mass per Unit Length

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit Units .NET API: Catalog Display Unit Types (DisplayUnitType Enum Values)

$
0
0

Revit .NET has provided the Units API since version 2014. In this series of posts, we are going to explore the Revit Units .NET API and provide sample code and analysis as usual.

Let’s catalog all display unit types (the API DisplayUnitType enum values).

        public static void CatalogDisplayUnitTypes()
        {
            Dictionary<string, List<DisplayUnitType>> dictCat2UT = new Dictionary<string, List<DisplayUnitType>>();
            foreach (DisplayUnitType ut in UnitUtils.GetValidDisplayUnits())
            {
                string catalog = UnitUtils.GetTypeCatalogString(ut);
                if (dictCat2UT.ContainsKey(catalog))
                    dictCat2UT[catalog].Add(ut);
                else
                    dictCat2UT.Add(catalog, new List<DisplayUnitType> { ut });
            }

            string info = "";
            using (StreamWriter sw = new StreamWriter(@"c:\temp\RevitDisplayUnitTypeCatalogs.txt"))
                foreach (KeyValuePair<string, List<DisplayUnitType>> entry in dictCat2UT)
                {
                    sw.WriteLine(entry.Key);
                    foreach (DisplayUnitType ut in entry.Value)
                    {
                        info = string.Format("\t{0} -- {1}", ut, LabelUtils.GetLabelFor(ut));
                        sw.WriteLine(info);
                    }
                }
        }
   

RevitUnitsAPI.CatalogDisplayUnitTypes();


The output may look something as follows:

FEET
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
INCHES
    DUT_DECIMAL_INCHES -- Decimal inches
    DUT_FRACTIONAL_INCHES -- Fractional inches
METERS
    DUT_METERS -- Meters
    DUT_METERS_CENTIMETERS -- Meters and centimeters
DECIMETERS
    DUT_DECIMETERS -- Decimeters
CENTIMETERS
    DUT_CENTIMETERS -- Centimeters
MILLIMETERS
    DUT_MILLIMETERS -- Millimeters
SQUARE_FEET
    DUT_SQUARE_FEET -- Square feet
SQUARE_INCHES
    DUT_SQUARE_INCHES -- Square inches
SQUARE_METERS
    DUT_SQUARE_METERS -- Square meters
SQUARE_CENTIMETERS
    DUT_SQUARE_CENTIMETERS -- Square centimeters
SQUARE_MILLIMETERS
    DUT_SQUARE_MILLIMETERS -- Square millimeters
ACRES
    DUT_ACRES -- Acres
HECTARES
    DUT_HECTARES -- Hectares
CUBIC_YARDS
    DUT_CUBIC_YARDS -- Cubic yards
CUBIC_FEET
    DUT_CUBIC_FEET -- Cubic feet
CUBIC_INCHES
    DUT_CUBIC_INCHES -- Cubic inches
CUBIC_METERS
    DUT_CUBIC_METERS -- Cubic meters
CUBIC_CENTIMETERS
    DUT_CUBIC_CENTIMETERS -- Cubic centimeters
CUBIC_MILLIMETERS
    DUT_CUBIC_MILLIMETERS -- Cubic millimeters
LITERS
    DUT_LITERS -- Liters
GALLONS
    DUT_GALLONS_US -- US gallons
DEGREES
    DUT_DECIMAL_DEGREES -- Decimal degrees
    DUT_DEGREES_AND_MINUTES -- Degrees minutes seconds
RATIO1
    DUT_1_RATIO -- 1 : Ratio
RATIO12
    DUT_RATIO_12 -- Ratio : 12
RATIO10
    DUT_RATIO_10 -- Ratio : 10
RISE_INCHES
    DUT_RISE_OVER_INCHES -- Rise / 12"
RISE_120_INCHES
    DUT_RISE_OVER_120_INCHES -- Rise / 120"
RISE_FOOT
    DUT_RISE_OVER_FOOT -- Rise / 1' - 0"
RISE_10_FOOT
    DUT_RISE_OVER_10_FEET -- Rise / 10'
RISE_MMS
    DUT_RISE_OVER_MMS -- Rise / 1000 mm
SLOPE_DEGREES
    DUT_SLOPE_DEGREES -- Decimal degrees

    DUT_GENERAL -- General
    DUT_FIXED -- Fixed
    DUT_CURRENCY -- Currency
    DUT_METERS_PER_KILONEWTON -- Meters per kilonewton
    DUT_FEET_PER_KIP -- Feet per kip
    DUT_SQUARE_METERS_PER_KILONEWTON -- Square meters per kilonewton
    DUT_SQUARE_FEET_PER_KIP -- Square feet per kip
    DUT_CUBIC_METERS_PER_KILONEWTON -- Cubic meters per kilonewton
    DUT_CUBIC_FEET_PER_KIP -- Cubic feet per kip
    DUT_INV_KILONEWTONS -- Inverse kilonewtons
    DUT_INV_KIPS -- Inverse kips
PERCENTAGE
    DUT_PERCENTAGE -- Percentage
PERMILLE
    DUT_PER_MILLE -- Per mille
KILOGRAMS_PER_CUBIC_METER
    DUT_KILOGRAMS_PER_CUBIC_METER -- Kilograms per cubic meter
POUNDS_MASS_PER_CUBIC_FOOT
    DUT_POUNDS_MASS_PER_CUBIC_FOOT -- Pounds per cubic foot
POUNDS_MASS_PER_CUBIC_INCH
    DUT_POUNDS_MASS_PER_CUBIC_INCH -- Pounds per cubic inch
BRITISH_THERMAL_UNITS
    DUT_BRITISH_THERMAL_UNITS -- British Thermal Units
CALORIES
    DUT_CALORIES -- Calories
KILOCALORIES
    DUT_KILOCALORIES -- Kilocalories
JOULES
    DUT_JOULES -- Joules
KILOWATT_HOURS
    DUT_KILOWATT_HOURS -- Kilowatt hours
THERMS
    DUT_THERMS -- Therms
INCHES_OF_WATER_PER_100FT
    DUT_INCHES_OF_WATER_PER_100FT -- Inches of water (60 °F) per 100 feet
PASCALS_PER_METER
    DUT_PASCALS_PER_METER -- Pascals per meter
WATTS
    DUT_WATTS -- Watts
KILOWATTS
    DUT_KILOWATTS -- Kilowatts
BRITISH_THERMAL_UNITS_PER_SECOND
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- BTU (British Thermal Units) per second
BRITISH_THERMAL_UNITS_PER_HOUR
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- BTU (British Thermal Units) per hour
CALORIES_PER_SECOND
    DUT_CALORIES_PER_SECOND -- Calories per second
KILOCALORIES_PER_SECOND
    DUT_KILOCALORIES_PER_SECOND -- Kilocalories per second
WATTS_PER_SQUARE_FOOT
    DUT_WATTS_PER_SQUARE_FOOT -- Watts per square foot
WATTS_PER_SQUARE_METER
    DUT_WATTS_PER_SQUARE_METER -- Watts per square meter
INCHES_OF_WATER
    DUT_INCHES_OF_WATER -- Inches of water (60 °F)
PASCALS
    DUT_PASCALS -- Pascals
KILOPASCALS
    DUT_KILOPASCALS -- Kilopascals
MEGAPASCALS
    DUT_MEGAPASCALS -- Megapascals
POUNDS_FORCE_PER_SQUARE_INCH
    DUT_POUNDS_FORCE_PER_SQUARE_INCH -- Pounds per square inch
INCHES_OF_MERCURY
    DUT_INCHES_OF_MERCURY -- Inches of mercury (32 °F)
MILLIMETERS_OF_MERCURY
    DUT_MILLIMETERS_OF_MERCURY -- Millimeters of mercury
ATMOSPHERES
    DUT_ATMOSPHERES -- Atmospheres
BARS
    DUT_BARS -- Bars
FAHRENHEIT
    DUT_FAHRENHEIT -- Fahrenheit
CELSIUS
    DUT_CELSIUS -- Celsius
KELVIN
    DUT_KELVIN -- Kelvin
RANKINE
    DUT_RANKINE -- Rankine
FEET_PER_MINUTE
    DUT_FEET_PER_MINUTE -- Feet per minute
METERS_PER_SECOND
    DUT_METERS_PER_SECOND -- Meters per second
CENTIMETERS_PER_MINUTE
    DUT_CENTIMETERS_PER_MINUTE -- Centimeters per minute
CUBIC_FEET_PER_MINUTE
    DUT_CUBIC_FEET_PER_MINUTE -- Cubic feet per minute
LITERS_PER_SECOND
    DUT_LITERS_PER_SECOND -- Liters per second
CUBIC_METERS_PER_SECOND
    DUT_CUBIC_METERS_PER_SECOND -- Cubic meters per second
CUBIC_METERS_PER_HOUR
    DUT_CUBIC_METERS_PER_HOUR -- Cubic meters per hour
GALLONS_US_PER_MINUTE
    DUT_GALLONS_US_PER_MINUTE -- US gallons per minute
GALLONS_US_PER_HOUR
    DUT_GALLONS_US_PER_HOUR -- US gallons per hour
WATTS_PER_SQUARE_METER_KELVIN
    DUT_WATTS_PER_SQUARE_METER_KELVIN -- Watts per square meter kelvin
SQUARE_METER_KELVIN_PER_WATT
    DUT_SQUARE_METER_KELVIN_PER_WATT -- Square meter kelvin per watt
BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT_FAHRENHEIT
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT_FAHRENHEIT -- BTU (British Thermal Units) per hour square foot degree Fahrenheit
HOUR_SQUARE_FOOT_FAHRENHEIT_PER_BRITISH_THERMAL_UNIT
    DUT_HOUR_SQUARE_FOOT_FAHRENHEIT_PER_BRITISH_THERMAL_UNIT -- Hour square foot degree Fahrenheit per BTU (British Thermal Unit)
BRITISH_THERMAL_UNIT_PER_FAHRENHEIT
    DUT_BRITISH_THERMAL_UNIT_PER_FAHRENHEIT -- BTU per degree Fahrenheit
JOULES_PER_KELVIN
    DUT_JOULES_PER_KELVIN -- Joules per degree Kelvin
KILOJOULES_PER_KELVIN
    DUT_KILOJOULES_PER_KELVIN -- Kilojoules per degree Kelvin
WATTS_PER_METER_KELVIN
    DUT_WATTS_PER_METER_KELVIN -- Watts per meter kelvin
BRITISH_THERMAL_UNITS_PER_HOUR_FOOT_FAHRENHEIT
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_FOOT_FAHRENHEIT -- BTU (British Thermal Units) per hour foot degree Fahrenheit
JOULES_PER_GRAM_CELSIUS
    DUT_JOULES_PER_GRAM_CELSIUS -- Joules per gram Celsius
JOULES_PER_KILOGRAM_CELSIUS
    DUT_JOULES_PER_KILOGRAM_CELSIUS -- Joules per kilogram Celsius
BRITISH_THERMAL_UNITS_PER_POUND_FAHRENHEIT
    DUT_BRITISH_THERMAL_UNITS_PER_POUND_FAHRENHEIT -- BTU (British Thermal Units) per pound Fahrenheit
JOULES_PER_GRAM
    DUT_JOULES_PER_GRAM -- Joules per gram
BRITISH_THERMAL_UNITS_PER_POUND
    DUT_BRITISH_THERMAL_UNITS_PER_POUND -- BTU (British Thermal Units) per pound
NANOGRAMS_PER_PASCAL_SECOND_SQUARE_METER
    DUT_NANOGRAMS_PER_PASCAL_SECOND_SQUARE_METER -- Nanograms per pascal second square meter
GRAINS_PER_HOUR_SQUARE_FOOT_INCH_MERCURY
    DUT_GRAINS_PER_HOUR_SQUARE_FOOT_INCH_MERCURY -- Grains per hour square foot inch mercury
OHM_METERS
    DUT_OHM_METERS -- Ohm meters
AMPERES
    DUT_AMPERES -- Amperes
KILOAMPERES
    DUT_KILOAMPERES -- Kiloamperes
MILLIAMPERES
    DUT_MILLIAMPERES -- Milliamperes
VOLTS
    DUT_VOLTS -- Volts
KILOVOLTS
    DUT_KILOVOLTS -- Kilovolts
MILLIVOLTS
    DUT_MILLIVOLTS -- Millivolts
HERTZ
    DUT_HERTZ -- Hertz
CYCLES_PER_SECOND
    DUT_CYCLES_PER_SECOND -- Cycles per second
LUX
    DUT_LUX -- Lux
FOOTCANDLES
    DUT_FOOTCANDLES -- Footcandles
FOOTLAMBERTS
    DUT_FOOTLAMBERTS -- Footlamberts
CANDELAS_PER_SQUARE_METER
    DUT_CANDELAS_PER_SQUARE_METER -- Candelas per square meter
LUMENS
    DUT_LUMENS -- Lumens
CANDELAS
    DUT_CANDELAS -- Candelas
VOLT_AMPERES
    DUT_VOLT_AMPERES -- Volt-amperes
KILOVOLT_AMPERES
    DUT_KILOVOLT_AMPERES -- Kilovolt-amperes
HORSEPOWER
    DUT_HORSEPOWER -- Horsepower
NEWTONS
    DUT_NEWTONS -- Newtons
DECANEWTONS
    DUT_DECANEWTONS -- Decanewtons
KILONEWTONS
    DUT_KILONEWTONS -- Kilonewtons
MEGANEWTONS
    DUT_MEGANEWTONS -- Meganewtons
KIPS
    DUT_KIPS -- Kips
KILOGRAMS_FORCE
    DUT_KILOGRAMS_FORCE -- Kilograms force
TONNES_FORCE
    DUT_TONNES_FORCE -- Tonnes force
POUNDS
    DUT_POUNDS_FORCE -- Pounds
NEWTONS_PER_METER
    DUT_NEWTONS_PER_METER -- Newtons per meter
DECANEWTONS_PER_METER
    DUT_DECANEWTONS_PER_METER -- Decanewtons per meter
KILONEWTONS_PER_METER
    DUT_KILONEWTONS_PER_METER -- Kilonewtons per meter
MEGANEWTONS_PER_METER
    DUT_MEGANEWTONS_PER_METER -- Meganewtons per meter
KIPS_PER_FOOT
    DUT_KIPS_PER_FOOT -- Kips per foot
KILOGRAMS_FORCE_PER_METER
    DUT_KILOGRAMS_FORCE_PER_METER -- Kilograms force per meter
TONNES_FORCE_PER_METER
    DUT_TONNES_FORCE_PER_METER -- Tonnes force per meter
POUNDS_FORCE_PER_FOOT
    DUT_POUNDS_FORCE_PER_FOOT -- Pounds per foot
NEWTONS_PER_SQUARE_METER
    DUT_NEWTONS_PER_SQUARE_METER -- Newtons per square meter
DECANEWTONS_PER_SQUARE_METER
    DUT_DECANEWTONS_PER_SQUARE_METER -- Decanewtons per square meter
KILONEWTONS_PER_SQUARE_METER
    DUT_KILONEWTONS_PER_SQUARE_METER -- Kilonewtons per square meter
MEGANEWTONS_PER_SQUARE_METER
    DUT_MEGANEWTONS_PER_SQUARE_METER -- Meganewtons per square meter
KILONEWTONS_PER_SQUARE_CENTIMETER
    DUT_KILONEWTONS_PER_SQUARE_CENTIMETER -- Kilonewtons per square centimeter
NEWTONS_PER_SQUARE_MILLIMETER
    DUT_NEWTONS_PER_SQUARE_MILLIMETER -- Newtons per square millimeter
KILONEWTONS_PER_SQUARE_MILLIMETER
    DUT_KILONEWTONS_PER_SQUARE_MILLIMETER -- Kilonewtons per square millimeter
KIPS_PER_SQUARE_FOOT
    DUT_KIPS_PER_SQUARE_FOOT -- Kips per square foot
KILOGRAMS_FORCE_PER_SQUARE_METER
    DUT_KILOGRAMS_FORCE_PER_SQUARE_METER -- Kilograms force per square meter
TONNES_FORCE_PER_SQUARE_METER
    DUT_TONNES_FORCE_PER_SQUARE_METER -- Tonnes force per square meter
POUNDS_FORCE_PER_SQUARE_FOOT
    DUT_POUNDS_FORCE_PER_SQUARE_FOOT -- Pounds per square foot
NEWTON_METERS
    DUT_NEWTON_METERS -- Newton-meters
DECANEWTON_METERS
    DUT_DECANEWTON_METERS -- Decanewton-meters
KILONEWTON_METERS
    DUT_KILONEWTON_METERS -- Kilonewton-meters
MEGANEWTON_METERS
    DUT_MEGANEWTON_METERS -- Meganewton-meters
KIP_FEET
    DUT_KIP_FEET -- Kip-feet
KILOGRAM_FORCE_METERS
    DUT_KILOGRAM_FORCE_METERS -- Kilogram force-meters
TONNE_FORCE_METERS
    DUT_TONNE_FORCE_METERS -- Tonne force-meters
POUND_FORCE_FEET
    DUT_POUND_FORCE_FEET -- Pound-feet
NEWTON_METERS_PER_METER
    DUT_NEWTON_METERS_PER_METER -- Newton-meters per meter
DECANEWTON_METERS_PER_METER
    DUT_DECANEWTON_METERS_PER_METER -- Decanewton-meters per meter
KILONEWTON_METERS_PER_METER
    DUT_KILONEWTON_METERS_PER_METER -- Kilonewton-meters per meter
MEGANEWTON_METERS_PER_METER
    DUT_MEGANEWTON_METERS_PER_METER -- Meganewton-meters per meter
KIP_FEET_PER_FOOT
    DUT_KIP_FEET_PER_FOOT -- Kip-feet per foot
KILOGRAM_FORCE_METERS_PER_METER
    DUT_KILOGRAM_FORCE_METERS_PER_METER -- Kilogram force-meters per meter
TONNE_FORCE_METERS_PER_METER
    DUT_TONNE_FORCE_METERS_PER_METER -- Tonne force-meters per meter
POUND_FORCE_FEET_PER_FOOT
    DUT_POUND_FORCE_FEET_PER_FOOT -- Pound-feet per foot
FEET_OF_WATER_PER_100FT
    DUT_FEET_OF_WATER_PER_100FT -- Feet of water (39.2 °F) per 100 feet
FEET_OF_WATER
    DUT_FEET_OF_WATER -- Feet of water (39.2 °F)
PASCAL_SECONDS
    DUT_PASCAL_SECONDS -- Pascal seconds
POUNDS_MASS_PER_FOOT_SECOND
    DUT_POUNDS_MASS_PER_FOOT_SECOND -- Pounds per foot second
CENTIPOISES
    DUT_CENTIPOISES -- Centipoises
FEET_PER_SECOND
    DUT_FEET_PER_SECOND -- Feet per second
KIPS_PER_SQUARE_INCH
    DUT_KIPS_PER_SQUARE_INCH -- Kips per square inch
POUNDS_FORCE_PER_CUBIC_FOOT
    DUT_POUNDS_FORCE_PER_CUBIC_FOOT -- Pounds per cubic foot
KIPS_PER_CUBIC_INCH
    DUT_KIPS_PER_CUBIC_INCH -- Kips per cubic inch
KILONEWTONS_PER_CUBIC_METER
    DUT_KILONEWTONS_PER_CUBIC_METER -- Kilonewtons per cubic meter
INVERSE_DEGREES_FAHRENHEIT
    DUT_INV_FAHRENHEIT -- Inverse degrees Fahrenheit
MICROINCHES_PER_INCH_FAHRENHEIT
    DUT_MICROINCHES_PER_INCH_FAHRENHEIT -- Microinches per inch Fahrenheit
INVERSE_DEGREES_CELSIUS
    DUT_INV_CELSIUS -- Inverse degrees Celsius
MICROMETERS_PER_METER_CELSIUS
    DUT_MICROMETERS_PER_METER_CELSIUS -- Micrometers per meter Celsius
POUNDS_MASS_PER_FOOT_HOUR
    DUT_POUNDS_MASS_PER_FOOT_HOUR -- Pounds per foot hour
KIPS_PER_INCH
    DUT_KIPS_PER_INCH -- Kips per inch
KIPS_PER_CUBIC_FOOT
    DUT_KIPS_PER_CUBIC_FOOT -- Kips per cubic foot
KIPS_PER_DEGREE
    DUT_KIP_FEET_PER_DEGREE -- Kip feet per degree
KILONEWTONS_PER_DEGREE
    DUT_KILONEWTON_METERS_PER_DEGREE -- Kilonewton meters per degree
KIPS_PER_DEGREE_PER_FOOT
    DUT_KIP_FEET_PER_DEGREE_PER_FOOT -- Kip feet per degree per foot
KILONEWTONS_PER_DEGREE_PER_METER
    DUT_KILONEWTON_METERS_PER_DEGREE_PER_METER -- Kilonewton meters per degree per meter
DUT_TON_OF_REFRIGERATION
    DUT_TON_OF_REFRIGERATION -- Tons of refrigeration (12 000 BTU (British Thermal Units) per hour)
DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT -- BTU (British Thermal Units) per hour square foot
WATTS_PER_CUBIC_FOOT
    DUT_WATTS_PER_CUBIC_FOOT -- Watts per cubic foot
WATTS_PER_CUBIC_METER
    DUT_WATTS_PER_CUBIC_METER -- Watts per cubic meter
DUT_BRITISH_THERMAL_UNITS_PER_HOUR_CUBIC_FOOT
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_CUBIC_FOOT -- BTU (British Thermal Units) per hour cubic foot
CUBIC_FEET_PER_MINUTE_SQUARE_FOOT
    DUT_CUBIC_FEET_PER_MINUTE_SQUARE_FOOT -- Cubic feet per minute square foot
LITERS_PER_SECOND_SQUARE_METER
    DUT_LITERS_PER_SECOND_SQUARE_METER -- Liters per second square meter
CUBIC_FEET_PER_MINUTE_CUBIC_FOOT
    DUT_CUBIC_FEET_PER_MINUTE_CUBIC_FOOT -- Cubic feet per minute cubic foot
LITERS_PER_SECOND_CUBIC_METER
    DUT_LITERS_PER_SECOND_CUBIC_METER -- Liters per second cubic meter
CUBIC_FEET_PER_MINUTE_TON_OF_REFRIGERATION
    DUT_CUBIC_FEET_PER_MINUTE_TON_OF_REFRIGERATION -- Cubic meters per minute tons of refrigeration
LITERS_PER_SECOND_KILOWATTS
    DUT_LITERS_PER_SECOND_KILOWATTS -- Liters per second kilowatts
SQUARE_FEET_PER_TON_OF_REFRIGERATION
    DUT_SQUARE_FEET_PER_TON_OF_REFRIGERATION -- Square feet per tons of refrigeration
CUBIC_SQUARE_METERS_PER_KILOWATTS
    DUT_SQUARE_METERS_PER_KILOWATTS -- Square meters per kilowatts
LUMENS_PER_WATT
    DUT_LUMENS_PER_WATT -- Lumens per watt
SQUARE_FEET_PER_THOUSAND_BRITISH_THERMAL_UNITS_PER_HOUR
    DUT_SQUARE_FEET_PER_THOUSAND_BRITISH_THERMAL_UNITS_PER_HOUR -- Square feet per thousand BTU (British Thermal Units) per hour
KILOGRAMS
    DUT_KILOGRAMS_MASS -- Kilograms
TONNES
    DUT_TONNES_MASS -- Tonnes
POUNDS_MASS
    DUT_POUNDS_MASS -- Pounds
METERS_PER_SECOND_SQUARED
    DUT_METERS_PER_SECOND_SQUARED -- Meters per second squared
KILOMETERS_PER_SECOND_SQUARED
    DUT_KILOMETERS_PER_SECOND_SQUARED -- Kilometers per second squared
INCHES_PER_SECOND_SQUARED
    DUT_INCHES_PER_SECOND_SQUARED -- Inches per second squared
FEET_PER_SECOND_SQUARED
    DUT_FEET_PER_SECOND_SQUARED -- Feet per second squared
MILES_PER_SECOND_SQUARED
    DUT_MILES_PER_SECOND_SQUARED -- Miles per second squared
FEET_TO_THE_FOURTH_POWER
    DUT_FEET_TO_THE_FOURTH_POWER -- Feet to the fourth power
INCHES_TO_THE_FOURTH_POWER
    DUT_INCHES_TO_THE_FOURTH_POWER -- Inches to the fourth power
MILLIMETERS_TO_THE_FOURTH_POWER
    DUT_MILLIMETERS_TO_THE_FOURTH_POWER -- Millimeters to the fourth power
CENTIMETERS_TO_THE_FOURTH_POWER
    DUT_CENTIMETERS_TO_THE_FOURTH_POWER -- Centimeters to the fourth power
METERS_TO_THE_FOURTH_POWER
    DUT_METERS_TO_THE_FOURTH_POWER -- Meters to the fourth power
FEET_TO_THE_SIXTH_POWER
    DUT_FEET_TO_THE_SIXTH_POWER -- Feet to the sixth power
INCHES_TO_THE_SIXTH_POWER
    DUT_INCHES_TO_THE_SIXTH_POWER -- Inches to the sixth power
MILLIMETERS_TO_THE_SIXTH_POWER
    DUT_MILLIMETERS_TO_THE_SIXTH_POWER -- Millimeters to the sixth power
CENTIMETERS_TO_THE_SIXTH_POWER
    DUT_CENTIMETERS_TO_THE_SIXTH_POWER -- Centimeters to the sixth power
METERS_TO_THE_SIXTH_POWER
    DUT_METERS_TO_THE_SIXTH_POWER -- Meters to the sixth power
SQUARE_FEET_PER_FOOT
    DUT_SQUARE_FEET_PER_FOOT -- Square feet per foot
SQUARE_INCHES_PER_FOOT
    DUT_SQUARE_INCHES_PER_FOOT -- Square inches per foot
SQUARE_MILLIMETERS_PER_METER
    DUT_SQUARE_MILLIMETERS_PER_METER -- Square millimeters per meter
SQUARE_CENTIMETERS_PER_METER
    DUT_SQUARE_CENTIMETERS_PER_METER -- Square centimeters per meter
SQUARE_METERS_PER_METER
    DUT_SQUARE_METERS_PER_METER -- Square meters per meter
KILOGRAMS_MASS_PER_METER
    DUT_KILOGRAMS_MASS_PER_METER -- Kilograms per meter
POUNDS_MASS_PER_FOOT
    DUT_POUNDS_MASS_PER_FOOT -- Pounds per foot
RADIANS
    DUT_RADIANS -- Radians
GRADS
    DUT_GRADS -- Grads
RADIANS_PER_SECOND
    DUT_RADIANS_PER_SECOND -- Radians per second
MILLISECONDS
    DUT_MILISECONDS -- Milliseconds
SECONDS
    DUT_SECONDS -- Seconds
MINUTES
    DUT_MINUTES -- Minutes
HOURS
    DUT_HOURS -- Hours
KILOMETERS_PER_HOUR
    DUT_KILOMETERS_PER_HOUR -- Kilometers per hour
MILES_PER_HOUR
    DUT_MILES_PER_HOUR -- Miles per hour
KILOJOULES
    DUT_KILOJOULES -- Kilojoules
POUNDS_MASS_PER_SQUARE_FOOT
    DUT_POUNDS_MASS_PER_SQUARE_FOOT -- Pounds per square foot
POUNDS_MASS_PER_SQUARE_METER
    DUT_KILOGRAMS_MASS_PER_SQUARE_METER -- Kilograms per square meter

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

 

Revit .NET has provided the Units API since version 2014. In this series of posts, we are going to explore the Revit Units .NET API and provide sample code and analysis as usual.

Let’s catalog all display unit types (the API DisplayUnitType enum values).

 

        publicstaticvoid CatalogDisplayUnitTypes()

        {

            Dictionary<string, List<DisplayUnitType>> dictCat2UT = newDictionary<string, List<DisplayUnitType>>();

            foreach (DisplayUnitType ut inUnitUtils.GetValidDisplayUnits())

            {

                string catalog = UnitUtils.GetTypeCatalogString(ut);

                if (dictCat2UT.ContainsKey(catalog))

                    dictCat2UT[catalog].Add(ut);

                else

                    dictCat2UT.Add(catalog, newList<DisplayUnitType> { ut });

            }

 

            string info = "";

            using (StreamWriter sw = newStreamWriter(@"c:\temp\RevitDisplayUnitTypeCatalogs.txt"))

                foreach (KeyValuePair<string, List<DisplayUnitType>> entry in dictCat2UT)

                {

                    sw.WriteLine(entry.Key);

                    foreach (DisplayUnitType ut in entry.Value)

                    {

                        info = string.Format("\t{0} -- {1}", ut, LabelUtils.GetLabelFor(ut));

                        sw.WriteLine(info);

                    }

                }

        }

 

      

RevitUnitsAPI.CatalogDisplayUnitTypes();

 

 

 

The output may look something as follows:

 

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

http://spiderinnet.typepad.com/blog/2011/05/revit-addin-wizardscoders-and-revit-api-widgets.html

Unit Catalog, UnitType, DisplayUnitType, Units, Revit .NET Addin Wizard, RevitNetAddinWizard

It catalogs all display unit types (DisplayUnitType) using Revit Units .NET API.

Revit Units .NET API: Figure Out Revit Internal Units Per Unit Type

$
0
0

Revit .NET has provided the Units API since version 2014. In this series of posts, we are going to explore the Revit Units .NET API and provide sample code and analysis as usual.

Let’s figure out all Revit internal units per unit type in this post.

        public static void FigureOutRevitInternalUnitsPerUnitType()
        {
            string info = "";
            using (StreamWriter sw = new StreamWriter(@"c:\temp\RevitInternalUnits.txt"))
            {
                foreach (UnitType ut in UnitUtils.GetValidUnitTypes())
                {
                    info = string.Format("{0} -- {1}", ut, LabelUtils.GetLabelFor(ut));
                    sw.WriteLine(info);
                    foreach (DisplayUnitType dut in UnitUtils.GetValidDisplayUnits(ut))
                    {
                        double value = UnitUtils.ConvertToInternalUnits(1.0, dut);
                        if (Math.Abs(value - 1.0) < 1e-6)
                        {
                            info = string.Format("\t{0} -- {1}", dut, LabelUtils.GetLabelFor(dut));
                            sw.WriteLine(info);
                        }
                    }
                }
            }
        }
    

RevitUnitsAPI.FigureOutRevitInternalUnitsPerUnitType();


The output may look something as follows:

UT_Number -- Number
    DUT_GENERAL -- General
    DUT_FIXED -- Fixed
    DUT_CURRENCY -- Currency
UT_Length -- Length
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Area -- Area
    DUT_SQUARE_FEET -- Square feet
UT_Volume -- Volume
    DUT_CUBIC_FEET -- Cubic feet
UT_Angle -- Angle
    DUT_RADIANS -- Radians
UT_SheetLength -- Sheet Length
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_SQUARE_FEET_PER_FOOT -- Square feet per foot
UT_DecSheetLength -- Sheet Length
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
    DUT_SQUARE_FEET_PER_FOOT -- Square feet per foot
UT_SiteAngle -- Site Angle
    DUT_RADIANS -- Radians
UT_HVAC_Density -- Density
UT_HVAC_Energy -- Energy
UT_HVAC_Friction -- Friction
UT_HVAC_Power -- Power
UT_HVAC_Power_Density -- Power Density
    DUT_WATTS_PER_SQUARE_METER -- Watts per square meter
UT_HVAC_Pressure -- Pressure
UT_HVAC_Temperature -- Temperature
    DUT_KELVIN -- Kelvin
UT_HVAC_Velocity -- Velocity
UT_HVAC_Airflow -- Air Flow
UT_HVAC_DuctSize -- Duct Size
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_HVAC_CrossSection -- Cross Section
    DUT_SQUARE_FEET -- Square feet
UT_HVAC_HeatGain -- Heat Gain
UT_Electrical_Current -- Current
    DUT_AMPERES -- Amperes
UT_Electrical_Potential -- Electrical Potential
UT_Electrical_Frequency -- Frequency
    DUT_HERTZ -- Hertz
    DUT_CYCLES_PER_SECOND -- Cycles per second
UT_Electrical_Illuminance -- Illuminance
    DUT_FOOTCANDLES -- Footcandles
UT_Electrical_Luminance -- Luminance
UT_Electrical_Luminous_Flux -- Luminous Flux
    DUT_LUMENS -- Lumens
UT_Electrical_Luminous_Intensity -- Luminous Intensity
    DUT_CANDELAS -- Candelas
UT_Electrical_Efficacy -- Efficacy
UT_Electrical_Wattage -- Wattage
UT_Color_Temperature -- Color Temperature
    DUT_KELVIN -- Kelvin
UT_Electrical_Power -- Power
UT_HVAC_Roughness -- Roughness
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Electrical_Apparent_Power -- Apparent Power
UT_Electrical_Power_Density -- Power Density
    DUT_WATTS_PER_SQUARE_METER -- Watts per square meter
UT_Piping_Density -- Density
UT_Piping_Flow -- Flow
UT_Piping_Friction -- Friction
UT_Piping_Pressure -- Pressure
UT_Piping_Temperature -- Temperature
    DUT_KELVIN -- Kelvin
UT_Piping_Velocity -- Velocity
    DUT_FEET_PER_SECOND -- Feet per second
UT_Piping_Viscosity -- Viscosity
UT_PipeSize -- Pipe Size
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Piping_Roughness -- Roughness
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Piping_Volume -- Volume
    DUT_CUBIC_FEET -- Cubic feet
UT_HVAC_Viscosity -- Viscosity
UT_HVAC_CoefficientOfHeatTransfer -- Coefficient of Heat Transfer
    DUT_WATTS_PER_SQUARE_METER_KELVIN -- Watts per square meter kelvin
UT_HVAC_ThermalResistance -- Thermal Resistance
    DUT_SQUARE_METER_KELVIN_PER_WATT -- Square meter kelvin per watt
UT_HVAC_ThermalMass -- Thermal Mass
UT_HVAC_ThermalConductivity -- Thermal Conductivity
UT_HVAC_SpecificHeat -- Specific Heat
UT_HVAC_SpecificHeatOfVaporization -- Specific Heat of Vaporization
UT_HVAC_Permeability -- Permeability
UT_Electrical_Resistivity -- Electrical Resistivity
UT_HVAC_Airflow_Density -- Air Flow Density
UT_Slope -- Slope
    DUT_1_RATIO -- 1 : Ratio
    DUT_RISE_OVER_FOOT -- Rise / 1' - 0"
UT_HVAC_Cooling_Load -- Cooling Load
UT_HVAC_Heating_Load -- Heating Load
UT_HVAC_Cooling_Load_Divided_By_Area -- Cooling Load divided by Area
    DUT_WATTS_PER_SQUARE_METER -- Watts per square meter
UT_HVAC_Heating_Load_Divided_By_Area -- Heating Load divided by Area
    DUT_WATTS_PER_SQUARE_METER -- Watts per square meter
UT_HVAC_Cooling_Load_Divided_By_Volume -- Cooling Load divided by Volume
UT_HVAC_Heating_Load_Divided_By_Volume -- Heating Load divided by Volume
UT_HVAC_Airflow_Divided_By_Volume -- Air Flow divided by Volume
UT_HVAC_Airflow_Divided_By_Cooling_Load -- Air Flow divided by Cooling Load
UT_HVAC_Area_Divided_By_Cooling_Load -- Area divided by Cooling Load
UT_HVAC_Area_Divided_By_Heating_Load -- Area divided by Heating Load
UT_WireSize -- Wire Diameter
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_HVAC_Slope -- Slope
    DUT_1_RATIO -- 1 : Ratio
    DUT_RISE_OVER_FOOT -- Rise / 1' - 0"
UT_Piping_Slope -- Slope
    DUT_1_RATIO -- 1 : Ratio
    DUT_RISE_OVER_FOOT -- Rise / 1' - 0"
UT_Currency -- Currency
    DUT_CURRENCY -- Currency
UT_MassDensity -- Mass Density
UT_HVAC_Factor -- Factor
    DUT_FIXED -- Fixed
UT_Electrical_Temperature -- Temperature
    DUT_KELVIN -- Kelvin
UT_Electrical_CableTraySize -- Cable Tray Size
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Electrical_ConduitSize -- Conduit Size
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Electrical_Demand_Factor -- Demand Factor
    DUT_FIXED -- Fixed
UT_HVAC_DuctInsulationThickness -- Duct Insulation Thickness
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_HVAC_DuctLiningThickness -- Duct Lining Thickness
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_PipeInsulationThickness -- Pipe Insulation Thickness
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Force -- Force
UT_LinearForce -- Linear Force
    DUT_NEWTONS_PER_METER -- Newtons per meter
UT_AreaForce -- Area Force
UT_Moment -- Moment
UT_LinearMoment -- Linear Moment
UT_ForceScale -- Force Scale
UT_LinearForceScale -- Linear Force Scale
UT_AreaForceScale -- Area Force Scale
UT_MomentScale -- Moment Scale
UT_LinearMomentScale -- Linear Moment Scale
UT_Stress -- Stress
UT_UnitWeight -- Unit Weight
UT_Weight -- Weight
UT_Mass -- Mass
    DUT_KILOGRAMS_MASS -- Kilograms
UT_MassPerUnitArea -- Mass per Unit Area
UT_ThermalExpansion -- Thermal Expansion Coefficient
    DUT_INV_CELSIUS -- Inverse degrees Celsius
UT_ForcePerLength -- Point Spring Coefficient
    DUT_NEWTONS_PER_METER -- Newtons per meter
UT_LinearForcePerLength -- Line Spring Coefficient
UT_AreaForcePerLength -- Area Spring Coefficient
UT_ForceLengthPerAngle -- Rotational Point Spring Coefficient
UT_LinearForceLengthPerAngle -- Rotational Line Spring Coefficient
UT_Displacement_Deflection -- Displacement/Deflection
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Rotation -- Rotation
    DUT_RADIANS -- Radians
UT_Period -- Period
    DUT_SECONDS -- Seconds
UT_Structural_Frequency -- Frequency
    DUT_HERTZ -- Hertz
UT_Pulsation -- Pulsation
    DUT_RADIANS_PER_SECOND -- Radians per second
UT_Structural_Velocity -- Velocity
    DUT_FEET_PER_SECOND -- Feet per second
UT_Acceleration -- Acceleration
    DUT_FEET_PER_SECOND_SQUARED -- Feet per second squared
UT_Energy -- Energy
UT_Reinforcement_Volume -- Reinforcement Volume
    DUT_CUBIC_FEET -- Cubic feet
UT_Reinforcement_Length -- Reinforcement Length
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Reinforcement_Area -- Reinforcement Area
    DUT_SQUARE_FEET -- Square feet
UT_Reinforcement_Area_per_Unit_Length -- Reinforcement Area per Unit Length
    DUT_SQUARE_FEET_PER_FOOT -- Square feet per foot
UT_Reinforcement_Spacing -- Reinforcement Spacing
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Reinforcement_Cover -- Reinforcement Cover
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Bar_Diameter -- Bar Diameter
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Crack_Width -- Crack Width
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Section_Dimension -- Section Dimension
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Section_Property -- Section Property
    DUT_DECIMAL_FEET -- Decimal feet
    DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
UT_Section_Area -- Section Area
    DUT_SQUARE_FEET -- Square feet
UT_Section_Modulus -- Section Modulus
    DUT_CUBIC_FEET -- Cubic feet
UT_Moment_of_Inertia -- Moment of Inertia
    DUT_FEET_TO_THE_FOURTH_POWER -- Feet to the fourth power
UT_Warping_Constant -- Warping Constant
    DUT_FEET_TO_THE_SIXTH_POWER -- Feet to the sixth power
UT_Mass_per_Unit_Length -- Mass per Unit Length
UT_Weight_per_Unit_Length -- Weight per Unit Length
    DUT_NEWTONS_PER_METER -- Newtons per meter
UT_Surface_Area -- Surface Area per Unit Length
    DUT_SQUARE_FEET_PER_FOOT -- Square feet per foot
UT_Pipe_Dimension -- Pipe Dimension
UT_PipeMass -- Mass
    DUT_KILOGRAMS_MASS -- Kilograms
UT_PipeMassPerUnitLength -- Mass per Unit Length

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit Units .NET API: Figure Out Revit Internal Units Per Unit Type (pt. 2)

$
0
0

Revit .NET has provided the Units API since version 2014. In this series of posts, we are going to explore the Revit Units .NET API and provide sample code and analysis as usual.

Last time, we used the Revit Units .NET API to sort out Revit internal units per unit type. However, we found that Revit did not have internal units for some unit types such as the following:

UT_HVAC_Density -- Density
UT_HVAC_Energy -- Energy
UT_HVAC_Friction -- Friction
UT_HVAC_Power -- Power
UT_PipeMassPerUnitLength -- Mass per Unit Length

Why is that?

Let’s figure it out in this post. To make things clear, we need more information to help analyze.  Obvious we can reuse the existing code but enhance it a bit.

        public static void FigureOutRevitInternalUnitsPerUnitType()
        {
            string info = "";
            using (StreamWriter sw = new StreamWriter(@"c:\temp\RevitInternalUnits.txt"))
            {
                System.Diagnostics.Debug.WriteLine("", "** Revit Internal Units **");
                foreach (UnitType ut in UnitUtils.GetValidUnitTypes())
                {
                    info = string.Format("{0} -- {1}", ut, LabelUtils.GetLabelFor(ut));
                    sw.WriteLine(info);
                    System.Diagnostics.Debug.WriteLine(ut, "Unit Type");
                    foreach (DisplayUnitType dut in UnitUtils.GetValidDisplayUnits(ut))
                    {
                        double value = UnitUtils.ConvertToInternalUnits(1.0, dut);
                        System.Diagnostics.Debug.WriteLine(string.Format("\t{0} -- {1}", dut, value));
                        if (Math.Abs(value - 1.0) < 0.01)
                        {
                            info = string.Format("\t{0} -- {1}", dut, LabelUtils.GetLabelFor(dut));
                            sw.WriteLine(info);
                        }
                    }
                }
            }
        }
    

RevitUnitsAPI.FigureOutRevitInternalUnitsPerUnitType();


As can be seen, we used a much tolerant tolerance this time for the unit conversion factor comparison, but the same results were got in the file output. Fortunately, we also added some debug output which would tell us why.

** Revit Internal Units **:
Unit Type: UT_Number
    DUT_GENERAL -- 1
    DUT_FIXED -- 1
    DUT_CURRENCY -- 1
    DUT_PERCENTAGE -- 0.01
Unit Type: UT_Length
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Area
    DUT_SQUARE_FEET -- 1
    DUT_SQUARE_INCHES -- 0.00694444444444444
    DUT_SQUARE_METERS -- 10.7639104167097
    DUT_SQUARE_CENTIMETERS -- 0.00107639104167097
    DUT_SQUARE_MILLIMETERS -- 1.07639104167097E-05
    DUT_ACRES -- 43560
    DUT_HECTARES -- 107639.104167097
Unit Type: UT_Volume
    DUT_CUBIC_YARDS -- 27
    DUT_CUBIC_FEET -- 1
    DUT_CUBIC_INCHES -- 0.000578703703703704
    DUT_CUBIC_METERS -- 35.3146667214886
    DUT_CUBIC_CENTIMETERS -- 3.53146667214886E-05
    DUT_CUBIC_MILLIMETERS -- 3.53146667214886E-08
    DUT_LITERS -- 0.0353146667214886
    DUT_GALLONS_US -- 0.133680563183524
Unit Type: UT_Angle
    DUT_DECIMAL_DEGREES -- 0.0174532925199433
    DUT_DEGREES_AND_MINUTES -- 0.0174532925199433
    DUT_RADIANS -- 1
    DUT_GRADS -- 0.015707963267949
Unit Type: UT_SheetLength
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
    DUT_SQUARE_FEET_PER_FOOT -- 1
    DUT_SQUARE_INCHES_PER_FOOT -- 0.00694444444444444
    DUT_SQUARE_MILLIMETERS_PER_METER -- 3.28083989501312E-06
    DUT_SQUARE_CENTIMETERS_PER_METER -- 0.000328083989501312
    DUT_SQUARE_METERS_PER_METER -- 3.28083989501312
Unit Type: UT_DecSheetLength
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
    DUT_SQUARE_FEET_PER_FOOT -- 1
    DUT_SQUARE_INCHES_PER_FOOT -- 0.00694444444444444
    DUT_SQUARE_MILLIMETERS_PER_METER -- 3.28083989501312E-06
    DUT_SQUARE_CENTIMETERS_PER_METER -- 0.000328083989501312
    DUT_SQUARE_METERS_PER_METER -- 3.28083989501312
Unit Type: UT_SiteAngle
    DUT_DECIMAL_DEGREES -- 0.0174532925199433
    DUT_DEGREES_AND_MINUTES -- 0.0174532925199433
    DUT_RADIANS -- 1
    DUT_GRADS -- 0.015707963267949
Unit Type: UT_HVAC_Density
    DUT_KILOGRAMS_PER_CUBIC_METER -- 0.028316846592
    DUT_POUNDS_MASS_PER_CUBIC_FOOT -- 0.45359237
    DUT_POUNDS_MASS_PER_CUBIC_INCH -- 783.80761536
Unit Type: UT_HVAC_Energy
    DUT_BRITISH_THERMAL_UNITS -- 11356.526682227
    DUT_CALORIES -- 45.0663401326803
    DUT_KILOCALORIES -- 45066.3401326803
    DUT_JOULES -- 10.7639104167097
    DUT_KILOWATT_HOURS -- 38750077.500155
    DUT_THERMS -- 1135657132.42538
Unit Type: UT_HVAC_Friction
    DUT_INCHES_OF_WATER_PER_100FT -- 0.75846432
    DUT_PASCALS_PER_METER -- 0.09290304
Unit Type: UT_HVAC_Power
    DUT_WATTS -- 10.7639104167097
    DUT_KILOWATTS -- 10763.9104167097
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- 11356.526682227
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- 3.15459074506305
    DUT_CALORIES_PER_SECOND -- 45.0663401326803
    DUT_KILOCALORIES_PER_SECOND -- 45066.3401326803
Unit Type: UT_HVAC_Power_Density
    DUT_WATTS_PER_SQUARE_FOOT -- 10.7639104167097
    DUT_WATTS_PER_SQUARE_METER -- 1
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT -- 3.15459074506305
Unit Type: UT_HVAC_Pressure
    DUT_INCHES_OF_WATER -- 75.846432
    DUT_PASCALS -- 0.3048
    DUT_KILOPASCALS -- 304.8
    DUT_MEGAPASCALS -- 304800
    DUT_POUNDS_FORCE_PER_SQUARE_INCH -- 2101.5219336
    DUT_INCHES_OF_MERCURY -- 1032.1713672
    DUT_MILLIMETERS_OF_MERCURY -- 40.63666752
    DUT_ATMOSPHERES -- 30883.86
    DUT_BARS -- 30480
Unit Type: UT_HVAC_Temperature
    DUT_FAHRENHEIT -- 255.927777777778
    DUT_CELSIUS -- 274.15
    DUT_KELVIN -- 1
    DUT_RANKINE -- 0.555555555555556
Unit Type: UT_HVAC_Velocity
    DUT_FEET_PER_MINUTE -- 0.0166666666666667
    DUT_METERS_PER_SECOND -- 3.28083989501312
    DUT_CENTIMETERS_PER_MINUTE -- 0.000546806649168854
Unit Type: UT_HVAC_Airflow
    DUT_CUBIC_FEET_PER_MINUTE -- 0.0166666666666667
    DUT_LITERS_PER_SECOND -- 0.0353146667214886
    DUT_CUBIC_METERS_PER_SECOND -- 35.3146667214886
    DUT_CUBIC_METERS_PER_HOUR -- 0.00980962964485794
    DUT_GALLONS_US_PER_MINUTE -- 0.00222800938639206
    DUT_GALLONS_US_PER_HOUR -- 3.7133489773201E-05
Unit Type: UT_HVAC_DuctSize
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_HVAC_CrossSection
    DUT_SQUARE_FEET -- 1
    DUT_SQUARE_INCHES -- 0.00694444444444444
    DUT_SQUARE_METERS -- 10.7639104167097
    DUT_SQUARE_CENTIMETERS -- 0.00107639104167097
    DUT_SQUARE_MILLIMETERS -- 1.07639104167097E-05
    DUT_ACRES -- 43560
    DUT_HECTARES -- 107639.104167097
Unit Type: UT_HVAC_HeatGain
    DUT_WATTS -- 10.7639104167097
    DUT_KILOWATTS -- 10763.9104167097
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- 11356.526682227
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- 3.15459074506305
    DUT_CALORIES_PER_SECOND -- 45.0663401326803
    DUT_KILOCALORIES_PER_SECOND -- 45066.3401326803
Unit Type: UT_Electrical_Current
    DUT_AMPERES -- 1
    DUT_KILOAMPERES -- 1000
    DUT_MILLIAMPERES -- 0.001
Unit Type: UT_Electrical_Potential
    DUT_VOLTS -- 10.7639104167097
    DUT_KILOVOLTS -- 10763.9104167097
    DUT_MILLIVOLTS -- 0.0107639104167097
Unit Type: UT_Electrical_Frequency
    DUT_HERTZ -- 1
    DUT_CYCLES_PER_SECOND -- 1
    DUT_CUBIC_FEET_PER_MINUTE_CUBIC_FOOT -- 0.0166666666666667
    DUT_LITERS_PER_SECOND_CUBIC_METER -- 0.001
Unit Type: UT_Electrical_Illuminance
    DUT_LUX -- 0.09290304
    DUT_FOOTCANDLES -- 0.9999999612864
Unit Type: UT_Electrical_Luminance
    DUT_FOOTLAMBERTS -- 0.31830987692736
    DUT_CANDELAS_PER_SQUARE_METER -- 0.09290304
Unit Type: UT_Electrical_Luminous_Flux
    DUT_LUMENS -- 1
Unit Type: UT_Electrical_Luminous_Intensity
    DUT_CANDELAS -- 1
Unit Type: UT_Electrical_Efficacy
    DUT_LUMENS_PER_WATT -- 0.09290304
Unit Type: UT_Electrical_Wattage
    DUT_WATTS -- 10.7639104167097
Unit Type: UT_Color_Temperature
    DUT_KELVIN -- 1
Unit Type: UT_Electrical_Power
    DUT_WATTS -- 10.7639104167097
    DUT_KILOWATTS -- 10763.9104167097
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- 11356.526682227
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- 3.15459074506305
    DUT_CALORIES_PER_SECOND -- 45.0663401326803
    DUT_KILOCALORIES_PER_SECOND -- 45066.3401326803
    DUT_VOLT_AMPERES -- 10.7639104167097
    DUT_KILOVOLT_AMPERES -- 10763.9104167097
    DUT_HORSEPOWER -- 8026.6466154635
Unit Type: UT_HVAC_Roughness
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Electrical_Apparent_Power
    DUT_WATTS -- 10.7639104167097
    DUT_KILOWATTS -- 10763.9104167097
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- 11356.526682227
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- 3.15459074506305
    DUT_CALORIES_PER_SECOND -- 45.0663401326803
    DUT_KILOCALORIES_PER_SECOND -- 45066.3401326803
    DUT_VOLT_AMPERES -- 10.7639104167097
    DUT_KILOVOLT_AMPERES -- 10763.9104167097
    DUT_HORSEPOWER -- 8026.6466154635
Unit Type: UT_Electrical_Power_Density
    DUT_WATTS_PER_SQUARE_FOOT -- 10.7639104167097
    DUT_WATTS_PER_SQUARE_METER -- 1
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT -- 3.15459074506305
Unit Type: UT_Piping_Density
    DUT_KILOGRAMS_PER_CUBIC_METER -- 0.028316846592
    DUT_POUNDS_MASS_PER_CUBIC_FOOT -- 0.45359237
    DUT_POUNDS_MASS_PER_CUBIC_INCH -- 783.80761536
Unit Type: UT_Piping_Flow
    DUT_LITERS_PER_SECOND -- 0.0353146667214886
    DUT_CUBIC_METERS_PER_SECOND -- 35.3146667214886
    DUT_CUBIC_METERS_PER_HOUR -- 0.00980962964485794
    DUT_GALLONS_US_PER_MINUTE -- 0.00222800938639206
    DUT_GALLONS_US_PER_HOUR -- 3.7133489773201E-05
Unit Type: UT_Piping_Friction
    DUT_PASCALS_PER_METER -- 0.09290304
    DUT_FEET_OF_WATER_PER_100FT -- 9.110676216
Unit Type: UT_Piping_Pressure
    DUT_PASCALS -- 0.3048
    DUT_KILOPASCALS -- 304.8
    DUT_MEGAPASCALS -- 304800
    DUT_POUNDS_FORCE_PER_SQUARE_INCH -- 2101.5219336
    DUT_INCHES_OF_MERCURY -- 1032.1713672
    DUT_MILLIMETERS_OF_MERCURY -- 40.63666752
    DUT_ATMOSPHERES -- 30883.86
    DUT_BARS -- 30480
    DUT_FEET_OF_WATER -- 911.041104
Unit Type: UT_Piping_Temperature
    DUT_FAHRENHEIT -- 255.927777777778
    DUT_CELSIUS -- 274.15
    DUT_KELVIN -- 1
    DUT_RANKINE -- 0.555555555555556
Unit Type: UT_Piping_Velocity
    DUT_METERS_PER_SECOND -- 3.28083989501312
    DUT_FEET_PER_SECOND -- 1
Unit Type: UT_Piping_Viscosity
    DUT_PASCAL_SECONDS -- 0.3048
    DUT_POUNDS_MASS_PER_FOOT_SECOND -- 0.45359237
    DUT_CENTIPOISES -- 0.0003048
    DUT_POUNDS_MASS_PER_FOOT_HOUR -- 0.000125997880555556
Unit Type: UT_PipeSize
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Piping_Roughness
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Piping_Volume
    DUT_CUBIC_YARDS -- 27
    DUT_CUBIC_FEET -- 1
    DUT_CUBIC_INCHES -- 0.000578703703703704
    DUT_CUBIC_METERS -- 35.3146667214886
    DUT_CUBIC_CENTIMETERS -- 3.53146667214886E-05
    DUT_CUBIC_MILLIMETERS -- 3.53146667214886E-08
    DUT_LITERS -- 0.0353146667214886
    DUT_GALLONS_US -- 0.133680563183524
Unit Type: UT_HVAC_Viscosity
    DUT_PASCAL_SECONDS -- 0.3048
    DUT_POUNDS_MASS_PER_FOOT_SECOND -- 0.45359237
    DUT_CENTIPOISES -- 0.0003048
    DUT_POUNDS_MASS_PER_FOOT_HOUR -- 0.000125997880555556
Unit Type: UT_HVAC_CoefficientOfHeatTransfer
    DUT_WATTS_PER_SQUARE_METER_KELVIN -- 1
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT_FAHRENHEIT -- 5.678263
Unit Type: UT_HVAC_ThermalResistance
    DUT_SQUARE_METER_KELVIN_PER_WATT -- 1
    DUT_HOUR_SQUARE_FOOT_FAHRENHEIT_PER_BRITISH_THERMAL_UNIT -- 0.17611016132736
Unit Type: UT_HVAC_ThermalMass
    DUT_BRITISH_THERMAL_UNIT_PER_FAHRENHEIT -- 20441.7480280086
    DUT_JOULES_PER_KELVIN -- 10.7639104167097
    DUT_KILOJOULES_PER_KELVIN -- 10763.9104167097
Unit Type: UT_HVAC_ThermalConductivity
    DUT_WATTS_PER_METER_KELVIN -- 3.28083989501312
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_FOOT_FAHRENHEIT -- 5.67826334111349
Unit Type: UT_HVAC_SpecificHeat
    DUT_JOULES_PER_GRAM_CELSIUS -- 10763.9104167097
    DUT_JOULES_PER_KILOGRAM_CELSIUS -- 10.7639104167097
    DUT_BRITISH_THERMAL_UNITS_PER_POUND_FAHRENHEIT -- 45066.3401326803
Unit Type: UT_HVAC_SpecificHeatOfVaporization
    DUT_JOULES_PER_GRAM -- 10763.9104167097
    DUT_BRITISH_THERMAL_UNITS_PER_POUND -- 25036.8556292668
Unit Type: UT_HVAC_Permeability
    DUT_NANOGRAMS_PER_PASCAL_SECOND_SQUARE_METER -- 3.048E-13
    DUT_GRAINS_PER_HOUR_SQUARE_FOOT_INCH_MERCURY -- 0.00415315358027003
Unit Type: UT_Electrical_Resistivity
    DUT_OHM_METERS -- 35.3146667214886
Unit Type: UT_HVAC_Airflow_Density
    DUT_CUBIC_FEET_PER_MINUTE_SQUARE_FOOT -- 0.0166666666666667
    DUT_LITERS_PER_SECOND_SQUARE_METER -- 0.00328083989501312
Unit Type: UT_Slope
    DUT_1_RATIO -- 1
    DUT_RATIO_12 -- 0.0833333333333333
    DUT_RATIO_10 -- 0.1
    DUT_RISE_OVER_INCHES -- 0.0833333333333333
    DUT_RISE_OVER_FOOT -- 1
    DUT_RISE_OVER_MMS -- 0.001
    DUT_SLOPE_DEGREES -- 0.0174550649282176
    DUT_PERCENTAGE -- 0.01
Unit Type: UT_HVAC_Cooling_Load
    DUT_WATTS -- 10.7639104167097
    DUT_KILOWATTS -- 10763.9104167097
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- 11356.526682227
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- 3.15459074506305
    DUT_TON_OF_REFRIGERATION -- 37855.0889407566
Unit Type: UT_HVAC_Heating_Load
    DUT_WATTS -- 10.7639104167097
    DUT_KILOWATTS -- 10763.9104167097
    DUT_BRITISH_THERMAL_UNITS_PER_SECOND -- 11356.526682227
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR -- 3.15459074506305
Unit Type: UT_HVAC_Cooling_Load_Divided_By_Area
    DUT_WATTS_PER_SQUARE_FOOT -- 10.7639104167097
    DUT_WATTS_PER_SQUARE_METER -- 1
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT -- 3.15459074506305
Unit Type: UT_HVAC_Heating_Load_Divided_By_Area
    DUT_WATTS_PER_SQUARE_FOOT -- 10.7639104167097
    DUT_WATTS_PER_SQUARE_METER -- 1
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_SQUARE_FOOT -- 3.15459074506305
Unit Type: UT_HVAC_Cooling_Load_Divided_By_Volume
    DUT_WATTS_PER_CUBIC_FOOT -- 10.7639104167097
    DUT_WATTS_PER_CUBIC_METER -- 0.3048
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_CUBIC_FOOT -- 3.15459074506305
Unit Type: UT_HVAC_Heating_Load_Divided_By_Volume
    DUT_WATTS_PER_CUBIC_FOOT -- 10.7639104167097
    DUT_WATTS_PER_CUBIC_METER -- 0.3048
    DUT_BRITISH_THERMAL_UNITS_PER_HOUR_CUBIC_FOOT -- 3.15459074506305
Unit Type: UT_HVAC_Airflow_Divided_By_Volume
    DUT_CUBIC_FEET_PER_MINUTE_CUBIC_FOOT -- 0.0166666666666667
    DUT_LITERS_PER_SECOND_CUBIC_METER -- 0.001
Unit Type: UT_HVAC_Airflow_Divided_By_Cooling_Load
    DUT_CUBIC_FEET_PER_MINUTE_TON_OF_REFRIGERATION -- 4.40275459205765E-07
    DUT_LITERS_PER_SECOND_KILOWATTS -- 3.28083989501312E-06
Unit Type: UT_HVAC_Area_Divided_By_Cooling_Load
    DUT_SQUARE_FEET_PER_TON_OF_REFRIGERATION -- 2.64165275523459E-05
    DUT_SQUARE_METERS_PER_KILOWATTS -- 0.001
Unit Type: UT_HVAC_Area_Divided_By_Heating_Load
    DUT_SQUARE_METERS_PER_KILOWATTS -- 0.001
    DUT_SQUARE_FEET_PER_THOUSAND_BRITISH_THERMAL_UNITS_PER_HOUR -- 0.000316998330628151
Unit Type: UT_WireSize
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_HVAC_Slope
    DUT_1_RATIO -- 1
    DUT_RATIO_12 -- 0.0833333333333333
    DUT_RATIO_10 -- 0.1
    DUT_RISE_OVER_INCHES -- 0.0833333333333333
    DUT_RISE_OVER_FOOT -- 1
    DUT_RISE_OVER_MMS -- 0.001
    DUT_SLOPE_DEGREES -- 0.0174550649282176
    DUT_PERCENTAGE -- 0.01
    DUT_PER_MILLE -- 0.001
Unit Type: UT_Piping_Slope
    DUT_1_RATIO -- 1
    DUT_RATIO_12 -- 0.0833333333333333
    DUT_RATIO_10 -- 0.1
    DUT_RISE_OVER_INCHES -- 0.0833333333333333
    DUT_RISE_OVER_120_INCHES -- 0.00833333333333333
    DUT_RISE_OVER_FOOT -- 1
    DUT_RISE_OVER_10_FEET -- 0.1
    DUT_RISE_OVER_MMS -- 0.001
    DUT_SLOPE_DEGREES -- 0.0174550649282176
    DUT_PERCENTAGE -- 0.01
    DUT_PER_MILLE -- 0.001
Unit Type: UT_Currency
    DUT_CURRENCY -- 1
Unit Type: UT_MassDensity
    DUT_KILOGRAMS_PER_CUBIC_METER -- 0.028316846592
    DUT_POUNDS_MASS_PER_CUBIC_FOOT -- 0.45359237
Unit Type: UT_HVAC_Factor
    DUT_FIXED -- 1
    DUT_PERCENTAGE -- 0.01
Unit Type: UT_Electrical_Temperature
    DUT_FAHRENHEIT -- 255.927777777778
    DUT_CELSIUS -- 274.15
    DUT_KELVIN -- 1
    DUT_RANKINE -- 0.555555555555556
Unit Type: UT_Electrical_CableTraySize
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Electrical_ConduitSize
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Electrical_Demand_Factor
    DUT_FIXED -- 1
    DUT_PERCENTAGE -- 0.01
Unit Type: UT_HVAC_DuctInsulationThickness
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_HVAC_DuctLiningThickness
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_PipeInsulationThickness
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Force
    DUT_NEWTONS -- 3.28083989501312
    DUT_DECANEWTONS -- 32.8083989501312
    DUT_KILONEWTONS -- 3280.83989501312
    DUT_MEGANEWTONS -- 3280839.89501312
    DUT_KIPS -- 14593.9029372064
    DUT_KILOGRAMS_FORCE -- 32.1739291338583
    DUT_TONNES_FORCE -- 32173.9291338583
    DUT_POUNDS_FORCE -- 14.5939029372064
Unit Type: UT_LinearForce
    DUT_NEWTONS_PER_METER -- 1
    DUT_DECANEWTONS_PER_METER -- 10
    DUT_KILONEWTONS_PER_METER -- 1000
    DUT_MEGANEWTONS_PER_METER -- 1000000
    DUT_KIPS_PER_FOOT -- 14593.9029372064
    DUT_KILOGRAMS_FORCE_PER_METER -- 9.8066136
    DUT_TONNES_FORCE_PER_METER -- 9806.6136
    DUT_POUNDS_FORCE_PER_FOOT -- 14.5939029372064
    DUT_KIPS_PER_INCH -- 175126.835246476
Unit Type: UT_AreaForce
    DUT_NEWTONS_PER_SQUARE_METER -- 0.3048
    DUT_DECANEWTONS_PER_SQUARE_METER -- 3.048
    DUT_KILONEWTONS_PER_SQUARE_METER -- 304.8
    DUT_MEGANEWTONS_PER_SQUARE_METER -- 304800
    DUT_KIPS_PER_SQUARE_FOOT -- 14593.9029372064
    DUT_KILOGRAMS_FORCE_PER_SQUARE_METER -- 2.98905582528
    DUT_TONNES_FORCE_PER_SQUARE_METER -- 2989.05582528
    DUT_POUNDS_FORCE_PER_SQUARE_FOOT -- 14.5939029372064
Unit Type: UT_Moment
    DUT_NEWTON_METERS -- 10.7639104167097
    DUT_DECANEWTON_METERS -- 107.639104167097
    DUT_KILONEWTON_METERS -- 10763.9104167097
    DUT_MEGANEWTON_METERS -- 10763910.4167097
    DUT_KIP_FEET -- 14593.9029372064
    DUT_KILOGRAM_FORCE_METERS -- 105.557510281687
    DUT_TONNE_FORCE_METERS -- 105557.510281687
    DUT_POUND_FORCE_FEET -- 14.5939029372064
Unit Type: UT_LinearMoment
    DUT_NEWTON_METERS_PER_METER -- 3.28083989501312
    DUT_DECANEWTON_METERS_PER_METER -- 32.8083989501312
    DUT_KILONEWTON_METERS_PER_METER -- 3280.83989501312
    DUT_MEGANEWTON_METERS_PER_METER -- 3280839.89501312
    DUT_KIP_FEET_PER_FOOT -- 14593.9029372064
    DUT_KILOGRAM_FORCE_METERS_PER_METER -- 32.1739291338583
    DUT_TONNE_FORCE_METERS_PER_METER -- 32173.9291338583
    DUT_POUND_FORCE_FEET_PER_FOOT -- 14.5939029372064
Unit Type: UT_ForceScale
    DUT_METERS_PER_KILONEWTON -- 0.001
    DUT_FEET_PER_KIP -- 6.85217658567918E-05
Unit Type: UT_LinearForceScale
    DUT_SQUARE_METERS_PER_KILONEWTON -- 0.00328083989501312
    DUT_SQUARE_FEET_PER_KIP -- 6.85217658567918E-05
    DUT_CUBIC_FEET_PER_MINUTE_TON_OF_REFRIGERATION -- 4.40275459205765E-07
    DUT_LITERS_PER_SECOND_KILOWATTS -- 3.28083989501312E-06
Unit Type: UT_AreaForceScale
    DUT_CUBIC_METERS_PER_KILONEWTON -- 0.0107639104167097
    DUT_CUBIC_FEET_PER_KIP -- 6.85217658567918E-05
Unit Type: UT_MomentScale
    DUT_INV_KILONEWTONS -- 0.0003048
    DUT_INV_KIPS -- 6.85217658567918E-05
Unit Type: UT_LinearMomentScale
    DUT_METERS_PER_KILONEWTON -- 0.001
    DUT_FEET_PER_KIP -- 6.85217658567918E-05
Unit Type: UT_Stress
    DUT_PASCALS -- 0.3048
    DUT_KILOPASCALS -- 304.8
    DUT_MEGAPASCALS -- 304800
    DUT_POUNDS_FORCE_PER_SQUARE_INCH -- 2101.5219336
    DUT_BARS -- 30480
    DUT_NEWTONS_PER_SQUARE_METER -- 0.3048
    DUT_DECANEWTONS_PER_SQUARE_METER -- 3.048
    DUT_KILONEWTONS_PER_SQUARE_METER -- 304.8
    DUT_MEGANEWTONS_PER_SQUARE_METER -- 304800
    DUT_KILONEWTONS_PER_SQUARE_CENTIMETER -- 3048000
    DUT_NEWTONS_PER_SQUARE_MILLIMETER -- 304800
    DUT_KILONEWTONS_PER_SQUARE_MILLIMETER -- 304800000
    DUT_KIPS_PER_SQUARE_FOOT -- 14593.9029372064
    DUT_KILOGRAMS_FORCE_PER_SQUARE_METER -- 2.98905582528
    DUT_TONNES_FORCE_PER_SQUARE_METER -- 2989.05582528
    DUT_POUNDS_FORCE_PER_SQUARE_FOOT -- 14.5939029372064
    DUT_KIPS_PER_SQUARE_INCH -- 2101522.02295772
Unit Type: UT_UnitWeight
    DUT_POUNDS_FORCE_PER_CUBIC_FOOT -- 14.5939029372064
    DUT_KIPS_PER_CUBIC_INCH -- 25218264.2754926
    DUT_KILONEWTONS_PER_CUBIC_METER -- 92.90304
Unit Type: UT_Weight
    DUT_NEWTONS -- 3.28083989501312
    DUT_DECANEWTONS -- 32.8083989501312
    DUT_KILONEWTONS -- 3280.83989501312
    DUT_MEGANEWTONS -- 3280839.89501312
    DUT_KIPS -- 14593.9029372064
    DUT_KILOGRAMS_FORCE -- 32.1739291338583
    DUT_TONNES_FORCE -- 32173.9291338583
    DUT_POUNDS_FORCE -- 14.5939029372064
Unit Type: UT_Mass
    DUT_KILOGRAMS_MASS -- 1
    DUT_TONNES_MASS -- 1000
    DUT_POUNDS_MASS -- 0.45359237
Unit Type: UT_MassPerUnitArea
    DUT_POUNDS_MASS_PER_SQUARE_FOOT -- 0.45359237
    DUT_KILOGRAMS_MASS_PER_SQUARE_METER -- 0.09290304
Unit Type: UT_ThermalExpansion
    DUT_INV_FAHRENHEIT -- 1.8
    DUT_MICROINCHES_PER_INCH_FAHRENHEIT -- 1.8E-06
    DUT_INV_CELSIUS -- 1
    DUT_MICROMETERS_PER_METER_CELSIUS -- 1E-06
Unit Type: UT_ForcePerLength
    DUT_NEWTONS_PER_METER -- 1
    DUT_DECANEWTONS_PER_METER -- 10
    DUT_KILONEWTONS_PER_METER -- 1000
    DUT_MEGANEWTONS_PER_METER -- 1000000
    DUT_KIPS_PER_FOOT -- 14593.9029372064
    DUT_KILOGRAMS_FORCE_PER_METER -- 9.8066136
    DUT_TONNES_FORCE_PER_METER -- 9806.6136
    DUT_POUNDS_FORCE_PER_FOOT -- 14.5939029372064
    DUT_KIPS_PER_INCH -- 175126.835246476
Unit Type: UT_LinearForcePerLength
    DUT_INCHES_OF_WATER -- 75.846432
    DUT_PASCALS -- 0.3048
    DUT_KILOPASCALS -- 304.8
    DUT_MEGAPASCALS -- 304800
    DUT_POUNDS_FORCE_PER_SQUARE_INCH -- 2101.5219336
    DUT_INCHES_OF_MERCURY -- 1032.1713672
    DUT_MILLIMETERS_OF_MERCURY -- 40.63666752
    DUT_ATMOSPHERES -- 30883.86
    DUT_BARS -- 30480
    DUT_NEWTONS_PER_SQUARE_METER -- 0.3048
    DUT_DECANEWTONS_PER_SQUARE_METER -- 3.048
    DUT_KILONEWTONS_PER_SQUARE_METER -- 304.8
    DUT_MEGANEWTONS_PER_SQUARE_METER -- 304800
    DUT_KILONEWTONS_PER_SQUARE_CENTIMETER -- 3048000
    DUT_NEWTONS_PER_SQUARE_MILLIMETER -- 304800
    DUT_KILONEWTONS_PER_SQUARE_MILLIMETER -- 304800000
    DUT_KIPS_PER_SQUARE_FOOT -- 14593.9029372064
    DUT_KILOGRAMS_FORCE_PER_SQUARE_METER -- 2.98905582528
    DUT_TONNES_FORCE_PER_SQUARE_METER -- 2989.05582528
    DUT_POUNDS_FORCE_PER_SQUARE_FOOT -- 14.5939029372064
    DUT_FEET_OF_WATER -- 911.041104
    DUT_KIPS_PER_SQUARE_INCH -- 2101522.02295772
Unit Type: UT_AreaForcePerLength
    DUT_INCHES_OF_WATER_PER_100FT -- 0.75846432
    DUT_PASCALS_PER_METER -- 0.09290304
    DUT_FEET_OF_WATER_PER_100FT -- 9.110676216
    DUT_POUNDS_FORCE_PER_CUBIC_FOOT -- 14.5939029372064
    DUT_KIPS_PER_CUBIC_INCH -- 25218264.2754926
    DUT_KILONEWTONS_PER_CUBIC_METER -- 92.90304
    DUT_KIPS_PER_CUBIC_FOOT -- 14593.9029372064
Unit Type: UT_ForceLengthPerAngle
    DUT_KIP_FEET_PER_DEGREE -- 14593.9029372064
    DUT_KILONEWTON_METERS_PER_DEGREE -- 10763.9104167097
Unit Type: UT_LinearForceLengthPerAngle
    DUT_KIP_FEET_PER_DEGREE_PER_FOOT -- 47880.2589803358
    DUT_KILONEWTON_METERS_PER_DEGREE_PER_METER -- 3280.83989501312
Unit Type: UT_Displacement_Deflection
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Rotation
    DUT_DECIMAL_DEGREES -- 0.0174532925199433
    DUT_DEGREES_AND_MINUTES -- 0.0174532925199433
    DUT_RADIANS -- 1
    DUT_GRADS -- 0.015707963267949
Unit Type: UT_Period
    DUT_MILISECONDS -- 0.001
    DUT_SECONDS -- 1
    DUT_MINUTES -- 60
    DUT_HOURS -- 3600
Unit Type: UT_Structural_Frequency
    DUT_HERTZ -- 1
Unit Type: UT_Pulsation
    DUT_RADIANS_PER_SECOND -- 1
Unit Type: UT_Structural_Velocity
    DUT_FEET_PER_MINUTE -- 0.0166666666666667
    DUT_METERS_PER_SECOND -- 3.28083989501312
    DUT_FEET_PER_SECOND -- 1
    DUT_KILOMETERS_PER_HOUR -- 0.911344415281423
    DUT_MILES_PER_HOUR -- 1.46666666666667
Unit Type: UT_Acceleration
    DUT_METERS_PER_SECOND_SQUARED -- 3.28083989501312
    DUT_KILOMETERS_PER_SECOND_SQUARED -- 3280.83989501312
    DUT_INCHES_PER_SECOND_SQUARED -- 0.0833333333333333
    DUT_FEET_PER_SECOND_SQUARED -- 1
    DUT_MILES_PER_SECOND_SQUARED -- 5280
Unit Type: UT_Energy
    DUT_JOULES -- 10.7639104167097
    DUT_NEWTON_METERS -- 10.7639104167097
    DUT_KILOGRAM_FORCE_METERS -- 105.557510281687
    DUT_POUND_FORCE_FEET -- 14.5939029372064
    DUT_KILOJOULES -- 10763.9104167097
Unit Type: UT_Reinforcement_Volume
    DUT_CUBIC_FEET -- 1
    DUT_CUBIC_INCHES -- 0.000578703703703704
    DUT_CUBIC_METERS -- 35.3146667214886
    DUT_CUBIC_CENTIMETERS -- 3.53146667214886E-05
Unit Type: UT_Reinforcement_Length
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_DECIMETERS -- 0.328083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Reinforcement_Area
    DUT_SQUARE_FEET -- 1
    DUT_SQUARE_INCHES -- 0.00694444444444444
    DUT_SQUARE_METERS -- 10.7639104167097
    DUT_SQUARE_CENTIMETERS -- 0.00107639104167097
    DUT_SQUARE_MILLIMETERS -- 1.07639104167097E-05
Unit Type: UT_Reinforcement_Area_per_Unit_Length
    DUT_SQUARE_FEET_PER_FOOT -- 1
    DUT_SQUARE_INCHES_PER_FOOT -- 0.00694444444444444
    DUT_SQUARE_MILLIMETERS_PER_METER -- 3.28083989501312E-06
    DUT_SQUARE_CENTIMETERS_PER_METER -- 0.000328083989501312
    DUT_SQUARE_METERS_PER_METER -- 3.28083989501312
Unit Type: UT_Reinforcement_Spacing
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Reinforcement_Cover
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
Unit Type: UT_Bar_Diameter
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
Unit Type: UT_Crack_Width
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Section_Dimension
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Section_Property
    DUT_DECIMAL_FEET -- 1
    DUT_FEET_FRACTIONAL_INCHES -- 1
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_METERS -- 3.28083989501312
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
    DUT_METERS_CENTIMETERS -- 3.28083989501312
Unit Type: UT_Section_Area
    DUT_SQUARE_FEET -- 1
    DUT_SQUARE_INCHES -- 0.00694444444444444
    DUT_SQUARE_METERS -- 10.7639104167097
    DUT_SQUARE_CENTIMETERS -- 0.00107639104167097
    DUT_SQUARE_MILLIMETERS -- 1.07639104167097E-05
Unit Type: UT_Section_Modulus
    DUT_CUBIC_FEET -- 1
    DUT_CUBIC_INCHES -- 0.000578703703703704
    DUT_CUBIC_METERS -- 35.3146667214886
    DUT_CUBIC_CENTIMETERS -- 3.53146667214886E-05
    DUT_CUBIC_MILLIMETERS -- 3.53146667214886E-08
Unit Type: UT_Moment_of_Inertia
    DUT_FEET_TO_THE_FOURTH_POWER -- 1
    DUT_INCHES_TO_THE_FOURTH_POWER -- 4.82253086419753E-05
    DUT_MILLIMETERS_TO_THE_FOURTH_POWER -- 1.15861767458952E-10
    DUT_CENTIMETERS_TO_THE_FOURTH_POWER -- 1.15861767458952E-06
    DUT_METERS_TO_THE_FOURTH_POWER -- 115.861767458952
Unit Type: UT_Warping_Constant
    DUT_FEET_TO_THE_SIXTH_POWER -- 1
    DUT_INCHES_TO_THE_SIXTH_POWER -- 3.34897976680384E-07
    DUT_MILLIMETERS_TO_THE_SIXTH_POWER -- 1.24712568564981E-15
    DUT_CENTIMETERS_TO_THE_SIXTH_POWER -- 1.24712568564981E-09
    DUT_METERS_TO_THE_SIXTH_POWER -- 1247.12568564981
Unit Type: UT_Mass_per_Unit_Length
    DUT_KILOGRAMS_MASS_PER_METER -- 0.3048
    DUT_POUNDS_MASS_PER_FOOT -- 0.45359237
Unit Type: UT_Weight_per_Unit_Length
    DUT_NEWTONS_PER_METER -- 1
    DUT_DECANEWTONS_PER_METER -- 10
    DUT_KILONEWTONS_PER_METER -- 1000
    DUT_MEGANEWTONS_PER_METER -- 1000000
    DUT_KIPS_PER_FOOT -- 14593.9029372064
    DUT_KILOGRAMS_FORCE_PER_METER -- 9.8066136
    DUT_TONNES_FORCE_PER_METER -- 9806.6136
    DUT_POUNDS_FORCE_PER_FOOT -- 14.5939029372064
    DUT_KIPS_PER_INCH -- 175126.835246476
Unit Type: UT_Surface_Area
    DUT_SQUARE_FEET_PER_FOOT -- 1
    DUT_SQUARE_METERS_PER_METER -- 3.28083989501312
Unit Type: UT_Pipe_Dimension
    DUT_DECIMAL_INCHES -- 0.0833333333333333
    DUT_FRACTIONAL_INCHES -- 0.0833333333333333
    DUT_CENTIMETERS -- 0.0328083989501312
    DUT_MILLIMETERS -- 0.00328083989501312
Unit Type: UT_PipeMass
    DUT_KILOGRAMS_MASS -- 1
    DUT_TONNES_MASS -- 1000
    DUT_POUNDS_MASS -- 0.45359237
Unit Type: UT_PipeMassPerUnitLength
    DUT_KILOGRAMS_MASS_PER_METER -- 0.3048
    DUT_POUNDS_MASS_PER_FOOT -- 0.45359237

Let’s put aside those HVAC units at this moment and focus on the last two unit types, Pipe Mass and Pipe Mass Per Unit Length. Clearly, the Pipe Mass has the internal unit as Kilograms Mass. Adding another simple fact that Revit uses FEET (no matter fractional or decimal) as the internal unit for length, the PipeMassPerUnitLength should have KILOGRAMS_MASS_PER_FOOT as internal, but the fact is that it’s not available! This explains also why a lot more other unit types don’t have internal units either. Not sure what the UnitUtils.ConvertToInternalUnits() method is going to really convert in these cases!

People can understand that Revit cannot cover all units of the real world as there are tons and some new are emerging, however, it is pretty out of expectation that not every unit type has an internal unit. Anyway, that is what it is! Hope the code and analysis here can help readers get some ideas about it.

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Infinity/DivideByZeroException/Division by Constant Zero Regarding Double/Int Types in C#

$
0
0

As we know, C# has introduced the concept of infinity for some time. Both double and float types have the PositiveInfinity and NagativeInfinity constants in recent C# versions and some other properties are provided as well such as IsPositiveInfinity and IsNagativeInfinity to help check the double and float values.

    double aaa = double.PositiveInfinity;
    double bbb = double.NegativeInfinity;

    float aaaa = float.PositiveInfinity;
    float bbbb = float.NegativeInfinity;

Moreover, the PositiveInfinity and NagativeInfinity will all take part into real calculations. That looks nice, but will only cause troubles based on our experiences.

The biggest problem we think is that the infinity concept only applies to the double and float values. For other types such as integer and decimal, they cannot hold infinity either positive or negative in the C# language so far.

When a good integer is trying to be divided by a zero constant, the C# editor would warn us with the tiny red wave lines under the expression with a tooltip along (Error: Division by constant zero), and the Visual Studio compiler will not let it go through.
DivisionByConstantZero
 
If the zero is assigned to an integer variable and then the variable is used to divide an integer constant, both the C# editor and compiler would be happy. However, when the code is being executed, a DivideByZeroException with an explanation like ‘Attempted to divide by zero’ would occur at run time.
  DivideByZero

All these inconsistencies seem not a big deal in case we don’t mix using them together. Otherwise, serious problems would come along. For example, if the following code is run,

    double a = 5.5;
    double b = 0;
    int c = (int)(Math.PI * 2 * a / b);
    double d = Math.PI * 2 / c;
    int i = (int)Math.Floor(180.0 / d);

    MessageBox.Show(i.ToString());

a result out of most people’s imaginations we believe would be generated:
  WrongInt

Let’s put aside the real value. Please pay attention to the sign. It is NEGATIVE!    

If no conversions between integer and double values at all, i.e. values are all in doubles, the output will be, ‘as expected’, Infinity.

    double a1 = 5.5;
    double b1 = 0;
    double c1 = (Math.PI * 2 * a1 / b1);
    double d1 = Math.PI * 2 / c1;
    double i1 = Math.Floor(180.0 / d1);

    MessageBox.Show(i1.ToString());

  Infinity

Good? Bad?

Readers make the judgement.

Overall, all these inconsistencies only cause trouble for people like us. If the infinity concept is not brought into C# at all such that exceptions would be thrown out in all cases including double/float and integer/decimal types as in old versions, people may not be so annoyed.

Ask a simple question: why cannot an integer be infinity if a double value can?

Haven’t we all seen something like this everywhere in math books?
  IntInfinity

If the integer infinity is not more important than the double infinity, should not they be equal at least? In fact, what’s the difference between integer infinity and double infinity by the way?

Some may argue that an integer in the computer world cannot hold infinity. Then can double type really do in the current 64-bit cyber world or maybe even 1024-bit one in the future?

Revit .NET API: Create Custom Dockable Pane (DockablePane) (pt. 1)

$
0
0

Revit .NET has provided the DockablePane API since version 2014. In this series of posts, we are going to explore the Revit DockablePane .NET API step by step.

In this part, we create the simplest custom DockablePane to get the basic idea first about the DockablePane API.

•    Use the Revit .NET Addin Wizard (RevitNetAddinWizard) to create a C# addin project for Revit 2014. To make it as simple as possible, we only need to name the project name as SimplestDockablePane and accept any other default settings.

•    Manully upgrade the project type of the SimplestDockablePane.csproj from Class Library to WPF User Control Library through adding the <ProjectTypeGuids> element to the Project/PropertyGroup:

<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

•    Now we can add a WPF Page to the DLL project. In the future, the Revit .NET Addin Wizard (RevitNetAddinWizard) will support the WPF User Control Library directly. Right click at the project name and choose Add -> Page.

•    Open the code-behind file (Page1.xmal.cs) of the Page1.xaml and add one more namespace:

using Autodesk.Revit.UI;

•    Add the IDockablePaneProvider interfact to the Page1 declaration to make it look like:

public partial class Page1 : Page, IDockablePaneProvider

•    Add the following method to the class:

public void SetupDockablePane(DockablePaneProviderData data)
{
data.FrameworkElement = this;

data.InitialState.DockPosition = DockPosition.Tabbed;
data.InitialState.TabBehind = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.PropertiesPalette;
}

•    Add the DockablePane registration code to the OnStartup of the ExtApp:

//TODO: add you code below.

Page1 page1 = new Page1();
DockablePaneId paneId = new DockablePaneId(Guid.NewGuid());
uiApp.RegisterDockablePane(paneId, "Page1", (IDockablePaneProvider)page1 );

That is about it. A complete working custom DockablePane addin has been successfully done and we are ready to press the F5 key to give it a try in the Revit 2014, as chosen during the project creation time by Revit .NET Addin Wizard (RevitNetAddinWizard).

We will notice that the Page1 Dockable Pane appears side by side with the Properties tab in the Properties parent dialog, as red-lined below.

DockablePaneToProperties
 

When it is clicked, we will see its content is as expected empty. We are going to enhance it a bit next. Please stay tuned.


Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.


Revit .NET API: Create Custom Dockable Pane (DockablePane) (pt. 2)

$
0
0

Revit .NET has provided the DockablePane API since version 2014. In this series of posts, we are going to explore the Revit DockablePane .NET API step by step.

In the first part, we created the simplest custom DockablePane to get the basic idea first about the DockablePane API. In this part, let’s enhance it a bit.

•    Add the following block to the Page.xmal file. Please make sure the image file exists or change it to any available.

    <Grid>
        <Image Name="image1" Stretch="Fill" Source="c:\temp\RevitAddinPane.jpg" />
    </Grid>

•    Replace the TabBehind of the InitialState from PropertiesPalatte to ElementView as follows:

            //data.InitialState.TabBehind = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.PropertiesPalette;
            data.InitialState.TabBehind = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.ElementView;

That is about it. Now we can press the F5 key to give it a try in the Revit 2014 again, as chosen during the project creation time by Revit .NET Addin Wizard (RevitNetAddinWizard).
This time, the Page1 DockablePane will be hosted by the ElementView window directly.
DockablePaneToElementsView

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Create Custom Dockable Pane (DockablePane) (pt. 3)

$
0
0

Revit .NET has provided the DockablePane API since version 2014. In this series of posts, we are going to explore the Revit DockablePane .NET API step by step.

In the first part, we created the simplest custom DockablePane to get the basic idea first about the DockablePane API. In the previous part, we enhanced the custom DockablePane a bit and docked it to the ElementView window instead. In this post, let’s see how to hide the custom DockablePane and show it again.

It is very simple to hide the custom DockablePane, simply through clicking the small tiny cross icon at the right top corner of the pane, so no need to create some explicit code to force it to happen. To show it again however, it needs a bit carefully thinking.

Rather than create a new instance of the custom DockablePane, we’d better find the existing instance and show the custom DockablePane if it is still valid.

                //TODO: add your code below.

                DockablePane pane = CachedUiApp.GetDockablePane(ExtApp.paneId);
                if (pane != null)
                {
                    pane.Show();
                }

The above code should be added to the Execute implementation of the ExtCmd class.

Another code change needs to be made is to store of the panel ID into a global variable of the ExtApp:

        #region Cached Variables

        public static DockablePaneId paneId;
        …
         
        #endregion

        #region IExternalApplication Members

        public Result OnStartup(UIControlledApplication uiApp)
        {

                //DockablePaneId paneId = new DockablePaneId(Guid.NewGuid());
                paneId = new DockablePaneId(Guid.NewGuid());

        }

That is about it. Now if the Page1 DockablePane has been hidden, it will show up again if we click the NSS tab => SimplestDockablePanel panel => ExtCmd button from the ribbon. Clicking the button multiple times won’t get any harm since the DockablePane.Show() call will handle the situation nicely. By the way, the ribbon NSS tab, the ribbon SimplestDockablePanel panel, and the ribbon ExtCmd button along with the ExtCmd command/class were are automatically generated by the Revit .NET Addin Wizard (RevitNetAddinWizard) by default.

So, we create and register the custom DockablePane at the start-up of the addin application, hide the DockablePane by manually clicking the x icon, and show the DockablePane again with the default ribbon button that is created by the Revit .NET Addin Wizard (RevitNetAddinWizard).

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Create Custom Dockable Pane (DockablePane) (pt. 4)

$
0
0

Revit .NET has provided the DockablePane API since version 2014. In this series of posts, we are going to explore the Revit DockablePane .NET API step by step.

In the first part, we created the simplest custom DockablePane to get the basic idea first about the DockablePane API. After that, we enhanced the custom DockablePane a bit and docked it to the ElementView window and created some code to show the custom DockablePane back in case it has been hidden.

In this post, let us add a button to the custom DockablePane and call the Revit Save command to save the current Revit model.

We add a button to the layout of the Page1.xaml first.

        <Button Content="Save" Height="23" Name="button1" Width="276" Click="button1_Click" />

Next, we add the following button callback and idling event handler to the code-behind file, Page1.xaml.cs:

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ExtApp._cachedUiCtrApp.Idling += UIAppEvent_Idling_Handler;
        }

        public static void UIAppEvent_Idling_Handler(Object sender, EventArgs args)
        {
            UIApplication uiApp = sender as Autodesk.Revit.UI.UIApplication;
            if (uiApp.CanPostCommand(RevitCommandId.LookupPostableCommandId(PostableCommand.Save)))
            {
                uiApp.PostCommand(RevitCommandId.LookupPostableCommandId(PostableCommand.Save));
            }
            uiApp.Idling -= UIAppEvent_Idling_Handler;
        }

That is about it. Now we can press the F5 key to test it. This time, the Page1 DockablePane has a button besides the underlying image that was added before. When the button is clicked the Save command will be sent to Revit to execute.
  DockablePaneButtonToSave

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Create Custom Dockable Pane (DockablePane) (pt. 5)

$
0
0

Revit .NET has provided the DockablePane API since version 2014. In this series of posts, we are going to explore the Revit DockablePane .NET API step by step.

In the first part, we created the simplest custom DockablePane to get the basic idea first about the DockablePane API. After that, we enhanced the custom DockablePane a bit and docked it to the ElementView window and created some code to show the custom DockablePane back in case it has been hidden. We also added a button to the custom DockablePane which will call the Revit Save command to save the current Revit model when being clicked.

In this post, we list out some information about the custom DockablePane and find out a serious limitation of the DockablePane API when doing so.

We add one more button to the layout of the Page1.xaml first.

        <Button Content="Get DockablePane Info" Height="23" HorizontalAlignment="Left" Margin="12,21,0,0" Name="button2" VerticalAlignment="Top" Width="276" Click="button2_Click" />

Next, we add the following button callback and idling event handler to the code-behind file, Page1.xaml.cs:

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            string msg = "Information about the DockablePane:\n";

            DockablePane pane = ExtApp._cachedUiCtrApp.GetDockablePane(ExtApp.paneId);
            if (pane != null)
            {
                msg += "\nTitle: " + pane.GetTitle();
                msg += "\nType: " + pane.GetType();
                msg += "\nId: " + pane.Id.Guid.ToString();
                msg += "\nIsValie: " + pane.IsValidObject;
            }

            System.Windows.Forms.MessageBox.Show(msg);
        }

That is about it. Now we can press the F5 key to test it. This time, the Page1 DockablePane has one more button besides the Save button at the middle center and the underlying image that were added before. When the button is clicked the some information about the DockablePanel will be displayed in a message box.
DockablePaneButtonInfo
 
However, it was found out that the DockablePanel has a serious limitation. That is, it does not carry any information about the hosted WPF Page/Window at all, and this fact makes it impossible to resize the pane, relocate it, or change any status of the DockablePane programmatically if nothing is done about it. In the coming post, we will work around the issue.

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Create Custom Dockable Pane (DockablePane) (pt. 6)

$
0
0

Revit .NET has provided the DockablePane API since version 2014. In this series of posts, we are going to explore the Revit DockablePane .NET API step by step.

In the first part, we created the simplest custom DockablePane to get the basic idea first about the DockablePane API. After that, we enhanced the custom DockablePane a bit and docked it to the ElementView window and created some code to show the custom DockablePane back in case it has been hidden. We also added a button to the custom DockablePane which will call the Revit Save command to save the current Revit model when being clicked.

Previously, we listed out some information about the custom DockablePane but found out the hosted WPF Page was not accessible from the DockablePane API itself. The limitation made the information listed out there not sufficient enough for programming purpose.

In this post, we are going to work around it, at least for our custom DockablePane of concern.

Declare one more cached variable in the ExtApp:

        public static Dictionary<DockablePaneId, DockablePaneProviderData> CachedPaneData;

Then cache both the DockablePaneId and the DockablePaneProviderData of the custom DockablePane of concern in the SetupDockablePane() method of the IDockablePaneProvider interface.

            if (ExtApp.CachedPaneData == null)
                ExtApp.CachedPaneData = new Dictionary<DockablePaneId, DockablePaneProviderData>();

            ExtApp.CachedPaneData[ExtApp.paneId] = data;

Now enhance the button callback as follows:

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            string msg = "Information about the DockablePane:\n";

            DockablePane pane = ExtApp._cachedUiCtrApp.GetDockablePane(ExtApp.paneId);
            if (pane != null)
            {
                msg += "\nTitle: " + pane.GetTitle();
                msg += "\nType: " + pane.GetType();
                msg += "\nId: " + pane.Id.Guid.ToString();
                msg += "\nIsValie: " + pane.IsValidObject;

                DockablePaneProviderData data = ExtApp.CachedPaneData[ExtApp.paneId];

                msg += "\nDockPosition: " + data.InitialState.DockPosition;
                msg += string.Format("\nFloatingRectangle: ({0},{1}) - ({2},{3})", data.InitialState.FloatingRectangle.Left, data.InitialState.FloatingRectangle.Top, data.InitialState.FloatingRectangle.Right, data.InitialState.FloatingRectangle.Bottom);
                msg += "\nTabBehind: " + data.InitialState.TabBehind.Guid.ToString();

                msg += "\nActualHeight: " + data.FrameworkElement.ActualHeight;
                msg += "\nActualWidth: " + data.FrameworkElement.ActualWidth;
                msg += "\nAllowDrop: " + data.FrameworkElement.AllowDrop;
                msg += "\nFlowDirection: " + data.FrameworkElement.FlowDirection;
                msg += "\nHeight: " + data.FrameworkElement.Height;
                msg += "\nWidth: " + data.FrameworkElement.Width;
                msg += "\nMargin: " + data.FrameworkElement.Margin;
            }

            System.Windows.Forms.MessageBox.Show(msg);
        }

That is about it. Now we can press the F5 key to test it. This time, the information about the DockablePanel is comprehensive.
DockablePaneButtonInfo2
 
The FloatingRectangle is strangly reported as double (0, 0). It might be that no default values were provided to the stucture during the creation of the custom DockablePane or simply indicating an issue somewhere.

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Create Custom Dockable Pane (DockablePane) (pt. 7)

$
0
0

Revit .NET has provided the DockablePane API since version 2014. In this series of posts, we are going to explore the Revit DockablePane .NET API step by step.

In the first part, we created the simplest custom DockablePane to get the basic idea first about the DockablePane API. After that, we enhanced the custom DockablePane a bit and docked it to the ElementView window and created some code to show the custom DockablePane back in case it has been hidden. We also added a button to the custom DockablePane which will call the Revit Save command to save the current Revit model when being clicked. We also listed out the information about both the custom DockablePane itself and WPF Page it hosted.

Since we have worked around the issue of not being able to directly access to the hosted WPF Page, it seems we can reset the custom DockablePane programmatically. Let’s give it a try.
Add one more button to the Page1.xaml:

        <Button Content="Make DockablePane Float" Height="23" HorizontalAlignment="Left" Margin="12,50,0,0" Name="button3" VerticalAlignment="Top" Width="276" Click="button3_Click" />

Implement its callback as follows.

        private void button3_Click(object sender, RoutedEventArgs e)
        {
            DockablePane pane = ExtApp._cachedUiCtrApp.GetDockablePane(ExtApp.paneId);
            if (pane != null)
            {
                DockablePaneProviderData data = ExtApp.CachedPaneData[ExtApp.paneId];

                data.InitialState.DockPosition = DockPosition.Floating;
                data.InitialState.FloatingRectangle.Left = 400;
                data.InitialState.FloatingRectangle.Top = 400;
                data.InitialState.FloatingRectangle.Right = 800;
                data.InitialState.FloatingRectangle.Bottom = 800;

                data.FrameworkElement.Width = 200;
                data.FrameworkElement.InvalidateVisual();

                pane.Hide();
                pane.Show();
            }
        }

Now we are expecting to see that the custom DockablePane will be made float and its size (FloatingRectangle) or at least its width should be changed. However, here is the result.
DockablePaneReset
 
Though the hosted WPF Page by the custom DockablePane has been changed successfully in the width, the custom DockablePane itself just ignores our request of making it float and changing its window size even if the Hide() and Show() pair have been tried to refresh the custom DockablePane.

The InitialState property of the DockablePaneProviderData object may indicate something; only the initial state of the custom DockablePane can be set through the DockablePaneProviderData object. After the DockablePaneProviderData object being registered and shown, the status such as docking or float, position, and tab behind of the custom DockablePane cannot be dynamically changed anymore.

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Create Custom Dockable Pane (DockablePane) (pt. 8)

$
0
0

Revit .NET has provided the DockablePane API since version 2014. In this series of posts, we are going to explore the Revit DockablePane .NET API step by step.

In the first part, we created the simplest custom DockablePane to get the basic idea first about the DockablePane API. After that, we enhanced the custom DockablePane a bit and docked it to the ElementView window and created some code to show the custom DockablePane back in case it has been hidden. We also added a button to the custom DockablePane which will call the Revit Save command to save the current Revit model when being clicked. We also listed out the information about both the custom DockablePane itself and WPF Page it hosted.

We tried to reset the status such as docking/float and size of the custom DockablePane programmatically last time using the Revit .NET DockablePane API directly but got no avail. This time, let’s try to list out all those native (built-in) DockablePane tabs such as Project Browser and Properties.

One again, add one more button to the Page1.xaml:

        <Button Content="List Native DockablePanes" Height="23" HorizontalAlignment="Left" Margin="12,79,0,0" Name="button4" VerticalAlignment="Top" Width="276" Click="button4_Click" />

Implement its callback as follows.

        private void button4_Click(object sender, RoutedEventArgs e)
        {
            string msg = "";

            DockablePaneId paneId = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.ElementView;
            msg += GetPaneInfo(paneId, "ElementView");
            DockablePaneId paneId2 = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.HostByLinkNavigator;
            msg += GetPaneInfo(paneId2, "HostByLinkNavigator");
            DockablePaneId paneId3 = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.ProjectBrowser;
            msg += GetPaneInfo(paneId3, "ProjectBrowser");
            DockablePaneId paneId4 = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.PropertiesPalette;
            msg += GetPaneInfo(paneId4, "PropertiesPalette");
            DockablePaneId paneId5 = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.RebarBrowser;
            msg += GetPaneInfo(paneId5, "RebarBrowser");
            DockablePaneId paneId6 = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.SystemNavigator;
            msg += GetPaneInfo(paneId6, "SystemNavigator");              

            System.Windows.Forms.MessageBox.Show(msg, "Information about the native DockablePane tabs");
        }

        private string GetPaneInfo(DockablePaneId paneId, string tabName)
        {
            string msg = "";
            DockablePane pane = ExtApp._cachedUiCtrApp.GetDockablePane(paneId);
            if (pane != null)
            {
                msg += "\nTab: " + tabName;
                //msg += "\n\tTitle: " + pane.GetTitle();
                msg += "\n\tType: " + pane.GetType();
                msg += "\n\tId: " + pane.Id.Guid.ToString();
                msg += "\n\tIsValie: " + pane.IsValidObject;
            }
            else
                msg += string.Format("The BuiltIn DockablePane {0} cannot be got.", tabName);

            return msg;
        }

This time, the result is pretty nice except that the DockablePane.GetTitle() call would crash Revit, which code line has been commented out, as noticed. It looks simply a bug of the Revit .NET DockablePane API.
DockablePaneNativeTabs

 Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.


Revit .NET API: Create Custom Dockable Pane (DockablePane) (pt. 9)

$
0
0

Revit .NET has provided the DockablePane API since version 2014. In this series of posts, we are going to explore the Revit DockablePane .NET API step by step.

This time, let’s do a simple task, attaching the custom DockablePanel to the Project Browser tab.

            //data.InitialState.TabBehind = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.PropertiesPalette;
            //data.InitialState.TabBehind = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.ElementView;
            data.InitialState.TabBehind = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.ProjectBrowser;

Here is the result.
  DockablePaneProjectBrowser

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Create Custom Dockable Pane (DockablePane) (pt. 10)

$
0
0

Revit .NET has provided the DockablePane API since version 2014. In this series of posts, we are going to explore the Revit DockablePane .NET API step by step.

In the first part, we created the simplest custom DockablePane to get the basic idea about the DockablePane API. After that, we enhanced the custom DockablePane step by step, e.g. docking it to the ElementView window, creating some code to show the custom DockablePane back, adding a button to the custom DockablePane which to call the Revit Save command, listing out the information about both the custom DockablePane itself and WPF Page it hosted, resetting the status such as docking/float and size of the custom DockablePane, listing out all native (built-in) DockablePane tabs such as Project Browser and Properties, and attaching the custom DockablePanel to a different tab, the Project Browser.

In this article, let us try to do the final task, which is also very common, unregistering the custom DockablePanel.

Through digging here and there, we found it is not possible since the Revit DockablePanel .NET API doesn’t provide any means about it.

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit Units .NET API: Figure out all Revit Unmodifiable Units

$
0
0

Revit .NET has provided the Units API since version 2014. In this series of posts, we explore the Revit Units .NET API a bit and provide sample code and analysis as usual.
Most of Revit Units are modifiable, but some are not. In this post, let’s figure out all those unmodifiable units.

        public static void FigureOutUnmodifiableRevitUnits(RvtDocument doc)
        {
            string info = "";
            using (StreamWriter sw = new StreamWriter(@"c:\temp\RevitUnmodifiableUnits.txt"))
            {
                sw.WriteLine("** Revit Unmodifiable Units **" + Environment.NewLine);
                Units units = doc.GetUnits();
                foreach (UnitType ut in UnitUtils.GetValidUnitTypes())
                {
                    if (!Units.IsModifiableUnitType(ut))
                    {
                        info = string.Format("{0} -- {1}", ut, LabelUtils.GetLabelFor(ut));
                        sw.WriteLine(info);

                        FormatOptions fmtOpts = units.GetFormatOptions(ut);
                        info = PrintOutRevitUnitInfo(ut, fmtOpts, "\t\t");
                        sw.WriteLine("\tFormat Options:" + Environment.NewLine + info);

                        sw.WriteLine("\tAvailable Display Units:");
                        foreach (DisplayUnitType dut in UnitUtils.GetValidDisplayUnits(ut))
                        {
                            info = string.Format("\t\t{0} -- {1}", dut, LabelUtils.GetLabelFor(dut));
                            sw.WriteLine(info);
                        }
                    }
                }
            }
        }

        public static string PrintOutRevitUnitInfo(UnitType ut, FormatOptions obj, string indent)
        {
            string msg = string.Format(indent + "{0} ({1}):" + Environment.NewLine, LabelUtils.GetLabelFor(ut), ut);

            msg += string.Format(indent + "\tAccuracy: {0}" + Environment.NewLine, obj.Accuracy);
            msg += string.Format(indent + "\tUnit display: {0} ({1})" + Environment.NewLine, LabelUtils.GetLabelFor(obj.DisplayUnits), obj.DisplayUnits);
            msg += string.Format(indent + "\tUnit symbol: {0}" + Environment.NewLine, obj.CanHaveUnitSymbol() ? string.Format("{0} ({1})", (obj.UnitSymbol == UnitSymbolType.UST_NONE ? "" : LabelUtils.GetLabelFor(obj.UnitSymbol)), obj.UnitSymbol) : "n/a");
            msg += string.Format(indent + "\tUse default: {0}" + Environment.NewLine, obj.UseDefault);
            msg += string.Format(indent + "\tUse grouping: {0}" + Environment.NewLine, obj.UseGrouping);
            msg += string.Format(indent + "\tUse digit grouping: {0}" + Environment.NewLine, obj.UseDigitGrouping);
            msg += string.Format(indent + "\tUse plus prefix: {0}" + Environment.NewLine, obj.CanUsePlusPrefix() ? obj.UsePlusPrefix.ToString() : "n/a");
            msg += string.Format(indent + "\tSuppress spaces: {0}" + Environment.NewLine, obj.CanSuppressSpaces() ? obj.SuppressSpaces.ToString() : "n/a");
            msg += string.Format(indent + "\tSuppress leading zeros: {0}" + Environment.NewLine, obj.CanSuppressLeadingZeros() ? obj.SuppressLeadingZeros.ToString() : "n/a");
            msg += string.Format(indent + "\tSuppress trailing zeros: {0}" + Environment.NewLine, obj.CanSuppressTrailingZeros() ? obj.SuppressTrailingZeros.ToString() : "n/a");

            return msg;
        }
    

RevitUnitsAPI.FigureOutUnmodifiableRevitUnits(CachedDoc);


The output may look something like the following:

** Revit Unmodifiable Units **

UT_Number -- Number
    Format Options:
        Number (UT_Number):
            Accuracy: 1E-06
            Unit display: General (DUT_GENERAL)
            Unit symbol: n/a
            Use default: False
            Use grouping: False
            Use digit grouping: False
            Use plus prefix: n/a
            Suppress spaces: n/a
            Suppress leading zeros: n/a
            Suppress trailing zeros: n/a

    Available Display Units:
        DUT_GENERAL -- General
        DUT_FIXED -- Fixed
        DUT_CURRENCY -- Currency
        DUT_PERCENTAGE -- Percentage
UT_SheetLength -- Sheet Length
    Format Options:
        Sheet Length (UT_SheetLength):
            Accuracy: 0.0078125
            Unit display: Fractional inches (DUT_FRACTIONAL_INCHES)
            Unit symbol: n/a
            Use default: False
            Use grouping: False
            Use digit grouping: False
            Use plus prefix: False
            Suppress spaces: n/a
            Suppress leading zeros: n/a
            Suppress trailing zeros: n/a

    Available Display Units:
        DUT_DECIMAL_FEET -- Decimal feet
        DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
        DUT_DECIMAL_INCHES -- Decimal inches
        DUT_FRACTIONAL_INCHES -- Fractional inches
        DUT_METERS -- Meters
        DUT_DECIMETERS -- Decimeters
        DUT_CENTIMETERS -- Centimeters
        DUT_MILLIMETERS -- Millimeters
        DUT_METERS_CENTIMETERS -- Meters and centimeters
        DUT_SQUARE_FEET_PER_FOOT -- Square feet per foot
        DUT_SQUARE_INCHES_PER_FOOT -- Square inches per foot
        DUT_SQUARE_MILLIMETERS_PER_METER -- Square millimeters per meter
        DUT_SQUARE_CENTIMETERS_PER_METER -- Square centimeters per meter
        DUT_SQUARE_METERS_PER_METER -- Square meters per meter
UT_DecSheetLength -- Sheet Length
    Format Options:
        Sheet Length (UT_DecSheetLength):
            Accuracy: 0.0001
            Unit display: Decimal inches (DUT_DECIMAL_INCHES)
            Unit symbol:  (UST_NONE)
            Use default: False
            Use grouping: False
            Use digit grouping: False
            Use plus prefix: False
            Suppress spaces: n/a
            Suppress leading zeros: n/a
            Suppress trailing zeros: False

    Available Display Units:
        DUT_DECIMAL_FEET -- Decimal feet
        DUT_FEET_FRACTIONAL_INCHES -- Feet and fractional inches
        DUT_DECIMAL_INCHES -- Decimal inches
        DUT_FRACTIONAL_INCHES -- Fractional inches
        DUT_METERS -- Meters
        DUT_DECIMETERS -- Decimeters
        DUT_CENTIMETERS -- Centimeters
        DUT_MILLIMETERS -- Millimeters
        DUT_METERS_CENTIMETERS -- Meters and centimeters
        DUT_SQUARE_FEET_PER_FOOT -- Square feet per foot
        DUT_SQUARE_INCHES_PER_FOOT -- Square inches per foot
        DUT_SQUARE_MILLIMETERS_PER_METER -- Square millimeters per meter
        DUT_SQUARE_CENTIMETERS_PER_METER -- Square centimeters per meter
        DUT_SQUARE_METERS_PER_METER -- Square meters per meter
UT_SiteAngle -- Site Angle
    Format Options:
        Site Angle (UT_SiteAngle):
            Accuracy: 0.000277777777777778
            Unit display: Degrees minutes seconds (DUT_DEGREES_AND_MINUTES)
            Unit symbol: n/a
            Use default: False
            Use grouping: False
            Use digit grouping: False
            Use plus prefix: n/a
            Suppress spaces: n/a
            Suppress leading zeros: n/a
            Suppress trailing zeros: n/a

    Available Display Units:
        DUT_DECIMAL_DEGREES -- Decimal degrees
        DUT_DEGREES_AND_MINUTES -- Degrees minutes seconds
        DUT_RADIANS -- Radians
        DUT_GRADS -- Grads
UT_ForceScale -- Force Scale
    Format Options:
        Force Scale (UT_ForceScale):
            Accuracy: 0.1
            Unit display: Feet per kip (DUT_FEET_PER_KIP)
            Unit symbol: ft/kip (UST_FT_PER_KIP)
            Use default: False
            Use grouping: False
            Use digit grouping: False
            Use plus prefix: n/a
            Suppress spaces: n/a
            Suppress leading zeros: n/a
            Suppress trailing zeros: False

    Available Display Units:
        DUT_METERS_PER_KILONEWTON -- Meters per kilonewton
        DUT_FEET_PER_KIP -- Feet per kip
UT_LinearForceScale -- Linear Force Scale
    Format Options:
        Linear Force Scale (UT_LinearForceScale):
            Accuracy: 0.1
            Unit display: Square feet per kip (DUT_SQUARE_FEET_PER_KIP)
            Unit symbol: ft²/kip (UST_FT_SUP_2_PER_KIP)
            Use default: False
            Use grouping: False
            Use digit grouping: False
            Use plus prefix: n/a
            Suppress spaces: n/a
            Suppress leading zeros: n/a
            Suppress trailing zeros: False

    Available Display Units:
        DUT_SQUARE_METERS_PER_KILONEWTON -- Square meters per kilonewton
        DUT_SQUARE_FEET_PER_KIP -- Square feet per kip
        DUT_CUBIC_FEET_PER_MINUTE_TON_OF_REFRIGERATION -- Cubic meters per minute tons of refrigeration
        DUT_LITERS_PER_SECOND_KILOWATTS -- Liters per second kilowatts
UT_AreaForceScale -- Area Force Scale
    Format Options:
        Area Force Scale (UT_AreaForceScale):
            Accuracy: 0.1
            Unit display: Cubic feet per kip (DUT_CUBIC_FEET_PER_KIP)
            Unit symbol: ft³/kip (UST_FT_SUP_3_PER_KIP)
            Use default: False
            Use grouping: False
            Use digit grouping: False
            Use plus prefix: n/a
            Suppress spaces: n/a
            Suppress leading zeros: n/a
            Suppress trailing zeros: False

    Available Display Units:
        DUT_CUBIC_METERS_PER_KILONEWTON -- Cubic meters per kilonewton
        DUT_CUBIC_FEET_PER_KIP -- Cubic feet per kip
UT_MomentScale -- Moment Scale
    Format Options:
        Moment Scale (UT_MomentScale):
            Accuracy: 0.1
            Unit display: Inverse kips (DUT_INV_KIPS)
            Unit symbol: 1/kip (UST_INV_KIP)
            Use default: False
            Use grouping: False
            Use digit grouping: False
            Use plus prefix: n/a
            Suppress spaces: n/a
            Suppress leading zeros: n/a
            Suppress trailing zeros: False

    Available Display Units:
        DUT_INV_KILONEWTONS -- Inverse kilonewtons
        DUT_INV_KIPS -- Inverse kips
UT_LinearMomentScale -- Linear Moment Scale
    Format Options:
        Linear Moment Scale (UT_LinearMomentScale):
            Accuracy: 0.1
            Unit display: Feet per kip (DUT_FEET_PER_KIP)
            Unit symbol: ft/kip (UST_FT_PER_KIP)
            Use default: False
            Use grouping: False
            Use digit grouping: False
            Use plus prefix: n/a
            Suppress spaces: n/a
            Suppress leading zeros: n/a
            Suppress trailing zeros: False

    Available Display Units:
        DUT_METERS_PER_KILONEWTON -- Meters per kilonewton
        DUT_FEET_PER_KIP -- Feet per kip

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit Units .NET API: Figure Combinations of Decimal Separator, Digit Grouping Separator and Digit Grouping Number in Revit

$
0
0

Revit .NET has provided the Units API since version 2014. In this series of posts, we explore the Revit Units .NET API a bit and provide sample code and analysis as usual.

To display an amount nicely, a decimal separator is necessary and it is better to group the digits as well. In English, the dot (period) is used as the decimal separator, the comma as the digit grouping separator, and three digits are in each group. For example, 1,234,567.89 is a nice expression. In some other countries or cultures, different combinations of decimal separator, digit group separator and digit group number will be used, e.g. in Italy, 1.234.567,89.

In this post, let’s figure all combinations of decimal separator, digit group separator and digit group number that Revit supports.

        public static void FigureGoodCombinationsOfDecimalSymbolAndDigitGroupingSymbolNumber()
        {
            using (StreamWriter sw = new StreamWriter(@"c:\temp\RevitGoodCombinationsOfDecimalSymbolAndDigitGroupingSymbolNumber.txt"))
            {
                sw.WriteLine("Combinations Of Decimal Symbol And Digit Grouping Symbol/Number");
                sw.WriteLine("Decimal Symbol, Digit Grouping Symbol, Digit Grouping Number");
                foreach (DecimalSymbol ds in Enum.GetValues(typeof(DecimalSymbol)))
                {
                    foreach (DigitGroupingSymbol dgs in Enum.GetValues(typeof(DigitGroupingSymbol)))
                    {
                        foreach (DigitGroupingAmount dga in Enum.GetValues(typeof(DigitGroupingAmount)))
                        {
                            if (Units.IsValidDecimalSymbolAndGrouping(ds, dgs, dga))
                            {
                                sw.WriteLine("{0}\t{1}\t{2}", ds, dgs, dga);
                            }
                        }
                    }
                }
            }
        }

RevitUnitsAPI.FigureGoodCombinationsOfDecimalSymbolAndDigitGroupingSymbolNumber();


The output may look something like the following:

Combinations Of Decimal Symbol And Digit Grouping Symbol/Number
Decimal Symbol, Digit Grouping Symbol, Digit Grouping Number
Dot    Dot    Two
Dot    Dot    Three
Dot    Comma    Two
Dot    Comma    Three
Dot    Space    Two
Dot    Space    Three
Dot    Apostrophe    Two
Dot    Apostrophe    Three
Dot    Apostrophe    Two
Dot    Apostrophe    Three
Comma    Dot    Two
Comma    Dot    Three
Comma    Comma    Two
Comma    Comma    Three
Comma    Space    Two
Comma    Space    Three
Comma    Apostrophe    Two
Comma    Apostrophe    Three
Comma    Apostrophe    Two
Comma    Apostrophe    Three

It is surprising to see that Dot can serve as both decimal separator and digit group separator at the same time, so does the Comma! Are these combinations really valid? Does anywhere in the world express numbers this way?

1,234,567,89
1.234.567.89

If so, it’s confusing, isn’t it? We can kind of figure what fractional digits (e.g. the 89 here) are in the expressions supposing only two are there, but what about there are three fractional digits?
As can also be seen, Revit does not support the apostrophe (’) being as decimal separator though it is really used somewhere in the world. In addition, in some cultures, the digit grouping number may be four to be meaningful!

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: PreviewControl

$
0
0

Revit .NET API has provided the nice PreviewControl since version 2013. If well used, it will make Revit addins look cool and behave professional.

From the next post on, we are going to demonstrate using PreviewControl in WPF pages step by step. Please stay tuned.

Viewing all 872 articles
Browse latest View live