예제 #1
0
파일: Log.cs 프로젝트: HoareLea/SAM_Revit
        public static Log Log(this AdjacencyCluster adjacencyCluster, Document document)
        {
            if (adjacencyCluster == null || document == null)
            {
                return(null);
            }

            Log result = new Log();

            foreach (Construction construction in adjacencyCluster.GetConstructions())
            {
                result.AddRange(Log(construction, document));
            }

            foreach (ApertureConstruction apertureConstruction in adjacencyCluster.ApertureConstructions())
            {
                result.AddRange(Log(apertureConstruction, document));
            }

            List <Panel> panels = adjacencyCluster.GetPanels();

            panels?.ForEach(x => Core.Modify.AddRange(result, Core.Revit.Create.Log(x, document)));

            List <Architectural.Level> levels = Architectural.Create.Levels(panels);

            if (levels == null || levels.Count == 0)
            {
                result.Add("Could not find proper levels in AdjacencyCluster", LogRecordType.Error);
            }
            else
            {
                result.AddRange(Architectural.Revit.Create.Log(levels, document));
            }

            foreach (Space space in adjacencyCluster.GetSpaces())
            {
                Core.Modify.AddRange(result, Log(space, document));
            }

            return(result);
        }