using Autodesk.Revit.DB;
using System;
using DisplayUnitType = Autodesk.Revit.DB.DisplayUnitType;
namespace HStation.RevitDev.RevitDataExport.Utility
{
public static class ParameterConvert
{
///
/// 压强:Revit内置单位转MPa
///
///
///
public static double? InnerToMPa(this object obj)
{
if (obj == null) return null;
try
{
return UnitUtils.ConvertFromInternalUnits(Convert.ToDouble(obj), DisplayUnitType.DUT_MEGAPASCALS);
//return UnitUtils.ConvertFromInternalUnits(Convert.ToDouble(obj), UnitTypeId.Megapascals);
}
catch (Exception ex)
{
return null;
}
}
}
}