diff --git a/src/CAD/IFox.CAD.Shared/ExtensionMethod/GeometryEx.cs b/src/CAD/IFox.CAD.Shared/ExtensionMethod/GeometryEx.cs index 58e9da30362db999f44a37c97423491dd950ce82..12355c0c6980e6267bbcbf50463e88d2f9eb5961 100644 --- a/src/CAD/IFox.CAD.Shared/ExtensionMethod/GeometryEx.cs +++ b/src/CAD/IFox.CAD.Shared/ExtensionMethod/GeometryEx.cs @@ -617,18 +617,6 @@ public static Point3d GetMidPointTo(this Point3d pt1, Point3d pt2) pt1.Z * 0.5 + pt2.Z * 0.5); } - /// - /// 获取两个点之间的中点 - /// - /// 第一点 - /// 第二点 - /// 返回两个点之间的中点 - public static Point2d GetMidPointTo(this Point2d pt1, Point2d pt2) - { - // (pt1 + pt2) / 2; // 溢出风险 - return new(pt1.X * 0.5 + pt2.X * 0.5, - pt1.Y * 0.5 + pt2.Y * 0.5); - } /// /// 根据世界坐标计算用户坐标 diff --git a/src/CAD/IFox.CAD.Shared/ExtensionMethod/Jig/JigExTransient.cs b/src/CAD/IFox.CAD.Shared/ExtensionMethod/Jig/JigExTransient.cs index 55f9e8e3354bd5cc5d51a36c8fb3a3feb40b8332..6dc7efc865af2262540f911b2d51a690c401e597 100644 --- a/src/CAD/IFox.CAD.Shared/ExtensionMethod/Jig/JigExTransient.cs +++ b/src/CAD/IFox.CAD.Shared/ExtensionMethod/Jig/JigExTransient.cs @@ -1,5 +1,4 @@ -#if acad -namespace IFoxCAD.Cad; +namespace IFoxCAD.Cad; /// /// 瞬态容器 @@ -139,5 +138,4 @@ protected virtual void Dispose(bool disposing) Clear();// 清空瞬态容器并移除对象在图纸上的显示 } #endregion -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/CAD/IFox.CAD.Shared/ExtensionMethod/ObjectIdEx.cs b/src/CAD/IFox.CAD.Shared/ExtensionMethod/ObjectIdEx.cs index 171d110360a6f4f650d7e0fbde3525ae59dad99d..9c2a3593a55fc2764839fdc77110d534730d8acb 100644 --- a/src/CAD/IFox.CAD.Shared/ExtensionMethod/ObjectIdEx.cs +++ b/src/CAD/IFox.CAD.Shared/ExtensionMethod/ObjectIdEx.cs @@ -76,8 +76,8 @@ public static ObjectId GetObjectId(this Database db, string handleString) { if (long.TryParse(handleString, System.Globalization.NumberStyles.HexNumber, null, out long l)) { - var hanle = new Handle(l); - if (db.TryGetObjectId(hanle, out ObjectId id)) + var handle = new Handle(l); + if (db.TryGetObjectId(handle, out ObjectId id)) { return id; } @@ -92,7 +92,7 @@ public static ObjectId GetObjectId(this Database db, string handleString) /// id有效返回 ,反之返回 public static bool IsOk(this ObjectId id) { - return !id.IsNull && id.IsValid && !id.IsErased && !id.IsEffectivelyErased && id.IsResident; + return id is { IsNull: false, IsValid: true, IsErased: false, IsEffectivelyErased: false, IsResident: true }; } ///