12345678910111213141516171819202122232425262728293031323334353637383940 |
- /*-------------------------------------------------------------------------
- * 功能描述:Converter
- * 作者:xulisong
- * 创建时间: 2019/6/17 12:01:36
- * 版本号:v1.0
- * -------------------------------------------------------------------------*/
- using JBIM;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using SAGA.RevitUtils.Extends;
- namespace RevitToJBim.Common
- {
- public static class BimConvert
- {
- public static readonly int CoordinateDecimalDigits = 2;
- public static double Round(double coordinateDecimal)
- {
- return Math.Round(coordinateDecimal, CoordinateDecimalDigits);
- }
- /// <summary>
- /// 英尺转换成现在阶段使用单位
- /// </summary>
- /// <param name="footValue"></param>
- /// <returns></returns>
- public static double FtToUse(this double footValue)
- {
- return Round(footValue.FromApi());
- }
- public static XYZ ConvertToXYZ(Autodesk.Revit.DB.XYZ xyz)
- {
- return new XYZ() {X = Round(xyz.X.FromApi()), Y = Round(xyz.Y.FromApi()), Z = Round(xyz.Z.FromApi()),};
- }
- }
- }
|