123456789101112131415161718192021222324252627 |
- using Autodesk.Revit.DB;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SAGA.RevitUtils
- {
- /// <summary>
- /// 元素相等比较器
- /// </summary>
- public class ElementEqualityComparer : IEqualityComparer<Element>
- {
- public bool Equals(Element x, Element y)
- {
- if (x == null || y == null)
- return false;
- return x.Id.IntegerValue == y.Id.IntegerValue;
- }
- public int GetHashCode(Element obj)
- {
- return obj.Id.IntegerValue;
- }
- }
- }
|