lixiaojun
2025-01-16 63854f704730af6f1f9a3cc08bc9276ac9350edc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using HStation.Model;
 
namespace HStation.Service
{
    /// <summary>
    /// Revit位置拓展
    /// </summary>
    internal static class RevitPositionExtensions
    {
        /// <summary>
        /// 距离
        /// </summary>
        /// <param name="rhs">自身位置</param>
        /// <param name="other">其他位置</param>
        /// <returns></returns>
        public static double Distance(this RevitPosition rhs, RevitPosition other)
        {
            if (rhs == null)
            {
                return default;
            }
            if (other == null)
            {
                return default;
            }
            return Math.Sqrt(Math.Pow(rhs.X - other.X, 2) + Math.Pow(rhs.Y - other.Y, 2) + Math.Pow(rhs.Z - other.Z, 2));
        }
 
    }
}