コード例 #1
0
ファイル: UnitHelper.cs プロジェクト: wzfxue/Revit
        public static double ConvertFromInchTo(double inch, VLUnitType type)
        {
            switch (type)
            {
            case VLUnitType.centimeter:
                return(inch * MmPerInch / 10);

            case VLUnitType.millimeter:
                return(inch * MmPerInch);

            default:
                throw new NotImplementedException("未实现该类型的单位换算");
            }
        }
コード例 #2
0
ファイル: UnitHelper.cs プロジェクト: wzfxue/Revit
        public static double ConvertToInch(double value, VLUnitType type)
        {
            switch (type)
            {
            case VLUnitType.centimeter:
                return(value / MmPerInch * 10);

            case VLUnitType.millimeter:
                return(value / MmPerInch);

            default:
                throw new NotImplementedException("未实现该类型的单位换算");
            }
        }
コード例 #3
0
ファイル: UnitHelper.cs プロジェクト: wzfxue/Revit
        public static double ConvertFromFootTo(double foot, VLUnitType type)
        {
            switch (type)
            {
            case VLUnitType.centimeter:
                return(foot * MmPerFoot / 10);

            case VLUnitType.millimeter:
                return(foot * MmPerFoot);

            default:
                throw new NotImplementedException("未实现该类型的单位换算");
            }
        }