SpaceExtend.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* ==============================================================================
  2. * 功能描述:SpaceExtend
  3. * 创 建 者:Garrett
  4. * 创建日期:2019/12/6 14:52:05
  5. * ==============================================================================*/
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using Autodesk.Revit.DB.Mechanical;
  12. using SAGA.DotNetUtils.Extend;
  13. using ServiceRevitLib.Common;
  14. namespace ServiceRevitLib.Extend
  15. {
  16. /// <summary>
  17. /// SpaceExtend
  18. /// </summary>
  19. public static class SpaceExtend
  20. {
  21. /// <summary>
  22. /// 手动删除的空间,仅在明细表中可见
  23. /// </summary>
  24. /// <param name="space"></param>
  25. /// <returns></returns>
  26. public static bool IsDeleteSpace(this Space space)
  27. {
  28. //周长
  29. double perimeter = space.Perimeter;
  30. //面积
  31. double area = space.Area;
  32. //空间比较特殊,周长为零就相当于删除
  33. return (perimeter.IsZero(MBIConst.SpacePerimeterTolerance)) || (area.IsZero(MBIConst.SpaceAreaTolerance));
  34. }
  35. }
  36. }