|
@@ -37,10 +37,21 @@ namespace RevitToJBim.Common
|
|
|
/// 将点转换成毫米单位形式
|
|
|
/// </summary>
|
|
|
/// <param name="xyz"></param>
|
|
|
+ /// <param name="ignoreZ">转换是否忽略Z</param>
|
|
|
/// <returns></returns>
|
|
|
- public static XYZ ConvertToXYZ(Autodesk.Revit.DB.XYZ xyz)
|
|
|
+ public static XYZ ConvertToXYZ(Autodesk.Revit.DB.XYZ xyz,bool ignoreZ=false)
|
|
|
{
|
|
|
- return new XYZ() {X = FtToUse(xyz.X), Y = FtToUse(xyz.Y), Z = FtToUse(xyz.Z), };
|
|
|
+ var result = new XYZ()
|
|
|
+ {
|
|
|
+ X = FtToUse(xyz.X),
|
|
|
+ Y = FtToUse(xyz.Y)
|
|
|
+ };
|
|
|
+ if (!ignoreZ)
|
|
|
+ {
|
|
|
+ result.Z = FtToUse(xyz.Z);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 转换成向量
|
|
@@ -54,11 +65,13 @@ namespace RevitToJBim.Common
|
|
|
/// <summary>
|
|
|
/// 将点转换成毫米单位形式
|
|
|
/// </summary>
|
|
|
- /// <param name="xyzes"></param>
|
|
|
+ /// <param name="xyzs"></param>
|
|
|
+ /// <param name="ignoreZ">转换是否忽略Z</param>
|
|
|
/// <returns></returns>
|
|
|
- public static List<XYZ> ConvertToXYZs(List<Autodesk.Revit.DB.XYZ> xyzs)
|
|
|
+ public static List<XYZ> ConvertToXYZs(List<Autodesk.Revit.DB.XYZ> xyzs, bool ignoreZ=false)
|
|
|
{
|
|
|
- return xyzs.Select(xyz=>ConvertToXYZ(xyz)).ToList();
|
|
|
+ return xyzs.Select(xyz=>ConvertToXYZ(xyz, ignoreZ)).ToList();
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|