12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
-
- using JBIM;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using JBIM.Definition;
- 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);
- }
-
-
-
-
-
- public static double FtToUse(this double footValue)
- {
- return Round(footValue.FromApi());
- }
-
-
-
-
-
- public static XYZ ConvertToXYZ(Autodesk.Revit.DB.XYZ xyz)
- {
- return new XYZ() {X = FtToUse(xyz.X), Y = FtToUse(xyz.Y), Z = FtToUse(xyz.Z), };
- }
-
-
-
-
-
- public static XYZ ConvertToDirection(Autodesk.Revit.DB.XYZ xyz)
- {
- return new XYZ() { X = xyz.X, Y = xyz.Y, Z = xyz.Z, };
- }
-
-
-
-
-
- public static List<XYZ> ConvertToXYZs(List<Autodesk.Revit.DB.XYZ> xyzs)
- {
- return xyzs.Select(xyz=>ConvertToXYZ(xyz)).ToList();
- }
- }
- }
|