| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using SAGA.MBI.DataArrange;
- using SAGA.MBI.Model;
- namespace SAGA.GplotRelationComputerManage
- {
- public class RevitModelPath
- {
- private static List<string> FilePaths = new List<string>();
- /// <summary>
- /// 获取所有Revit文件信息(目录结构:根目录+proId+proName+builtingName)
- /// </summary>
- /// <returns></returns>
- public static List<string> GetAllRevitFiles()
- {
- if (FilePaths.Count == 0)
- {
- List<string> files = new List<string>();
- var projectFloors = DalModeFileManange.GetMissFileFloors(false);
- projectFloors.ForEach((tni) => GetFilePaths(tni, files));
- files.Reverse();
- FilePaths = new List<string>(files);
- }
- return FilePaths;
- }
- /// <summary>
- /// 获取所有楼层信息
- /// </summary>
- /// <param name="tni"></param>
- /// <param name="files"></param>
- private static void GetFilePaths(TreeNodeItem tni, List<string> files)
- {
- if (tni.Item is MFloor floor)
- {
- files.Add(floor.FullPath);
- }
- else
- {
- foreach (TreeNodeItem t in tni.Children)
- {
- GetFilePaths(t, files);
- }
- }
- }
- }
- }
|