using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Newtonsoft.Json;
using SAGA.DotNetUtils.Data;
using SAGA.DotNetUtils.Geometry;
using SAGA.RevitUtils;
using SAGA.RevitUtils.Extends;

namespace ServiceRevitLib
{
    #region 测试命令

    public class ServiceDataCheckTest
    {
        public static void Check(Document doc)
        {
            try
            {
                var factory = new CheckFactory();
                factory.SetCheckItems("SagaCheck,UnitCheck,FamilyNameCheck,EquipPartLocationCheck,ColumnCheck,ElementRangeCheck,ConnectorCheck,SystemNameCheck,EquipInSpaceCheck,SystemReferEquipCheck,ParameterIntegrityCheck");
                factory.Check(doc);
                var result = JsonConvert.SerializeObject(factory);
                string fileName = DateTime.Now.ToString("yyyyMMddHHmmss");
                string path = Path.Combine(@"D:\", $"DataCheck{fileName}.json");
                File.WriteAllText(path, result);
                //System.Diagnostics.Process.Start("notepad.exe", path);
            }
            catch (Exception e)
            {
            }
        }
    }
   

    #endregion
}
