M

UnitUtils.Convert

Description:
Converts a value from one display unit to another, such as square feet to square meters.
public static double Convert(
	double value,
	DisplayUnitType currentDisplayUnit,
	DisplayUnitType desiredDisplayUnit
)
Return Value The converted value. The converted value.
void SetTopOffset(Wall wall, double dOffsetInches)
{
    // convert user-defined offset value to feet from inches prior to setting
    double dOffsetFeet = UnitUtils.Convert(dOffsetInches, 
                                            DisplayUnitType.DUT_DECIMAL_INCHES, 
                                            DisplayUnitType.DUT_DECIMAL_FEET);

    Parameter paramTopOffset = wall.get_Parameter(BuiltInParameter.WALL_TOP_OFFSET);
    paramTopOffset.Set(dOffsetFeet);
}