/* ==============================================================================
 * 功能描述：SpaceExtend  
 * 创 建 者：Garrett
 * 创建日期：2019/12/6 14:52:05
 * ==============================================================================*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.DB.Mechanical;
using SAGA.DotNetUtils.Extend;
using ServiceRevitLib.Common;

namespace ServiceRevitLib.Extend
{
    /// <summary>
    /// SpaceExtend
    /// </summary>
    public static class SpaceExtend
    {
        /// <summary>
        /// 手动删除的空间，仅在明细表中可见
        /// </summary>
        /// <param name="space"></param>
        /// <returns></returns>
        public static bool IsDeleteSpace(this Space space)
        {
            //周长
            double perimeter = space.Perimeter;
            //面积
            double area = space.Area;
            //空间比较特殊，周长为零就相当于删除
            return (perimeter.IsZero(MBIConst.SpacePerimeterTolerance)) || (area.IsZero(MBIConst.SpaceAreaTolerance));
        }
    }
}
