|
@@ -0,0 +1,55 @@
|
|
|
+/*-------------------------------------------------------------------------
|
|
|
+ * 功能描述:SystemComputerContext
|
|
|
+ * 作者:xulisong
|
|
|
+ * 创建时间: 2019/1/4 17:52:22
|
|
|
+ * 版本号:v1.0
|
|
|
+ * -------------------------------------------------------------------------*/
|
|
|
+
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.IO;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using SAGA.RevitUtils.Extends;
|
|
|
+
|
|
|
+namespace SAGA.GplotRelationComputerManage
|
|
|
+{
|
|
|
+ public class SystemComputerContext
|
|
|
+ {
|
|
|
+ public SystemComputerContext()
|
|
|
+ {
|
|
|
+ FloorItems = new Dictionary<string, FloorSystemItems>();
|
|
|
+ }
|
|
|
+ #region 空间计算缓存信息
|
|
|
+ /// <summary>
|
|
|
+ /// 楼层系统数据缓存
|
|
|
+ /// </summary>
|
|
|
+ public Dictionary<string, FloorSystemItems> FloorItems { get; private set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取指定路径项目的楼层信息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="path"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public FloorSystemItems GetFloorItems(string path)
|
|
|
+ {
|
|
|
+ var floorId = Path.GetFileNameWithoutExtension(path);
|
|
|
+ if (FloorItems.TryGetValue(floorId, out FloorSystemItems floor))
|
|
|
+ {
|
|
|
+ return floor;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (File.Exists(path))
|
|
|
+ {
|
|
|
+ var uiApp = ExternalDataWrapper.Current.UiApp.Application;
|
|
|
+ var doc = uiApp.OpenDocumentFile(path);
|
|
|
+ floor = new FloorSystemItems(doc);
|
|
|
+ FloorItems[floorId] = floor;
|
|
|
+ }
|
|
|
+ return floor;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+}
|