1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
-
- 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,bool ignoreZ=false)
- {
- var result = new XYZ()
- {
- X = FtToUse(xyz.X),
- Y = FtToUse(xyz.Y)
- };
- if (!ignoreZ)
- {
- result.Z = FtToUse(xyz.Z);
- }
- return result;
- }
-
-
-
-
-
- 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, bool ignoreZ=false)
- {
- return xyzs.Select(xyz=>ConvertToXYZ(xyz, ignoreZ)).ToList();
- }
-
- }
- }
|