From 7d3aa07f6f94c70ca0a631a45db6565a5a58d9cf Mon Sep 17 00:00:00 2001 From: qin <a@163.com> Date: 星期四, 29 八月 2024 13:33:15 +0800 Subject: [PATCH] 优化自动增加属性方法 --- HStation.RevitDev/RevitDataExport/Service/RevitMepElementService.cs | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/HStation.RevitDev/RevitDataExport/Service/RevitMepElementService.cs b/HStation.RevitDev/RevitDataExport/Service/RevitMepElementService.cs index 77212ac..35fc267 100644 --- a/HStation.RevitDev/RevitDataExport/Service/RevitMepElementService.cs +++ b/HStation.RevitDev/RevitDataExport/Service/RevitMepElementService.cs @@ -151,12 +151,15 @@ return instances; } - public static ObservableCollection<ElementModel> GetElementModels(RevitType type) + public static List<string> GetElementModels(RevitType type) { - ObservableCollection<ElementModel> ret = new ObservableCollection<ElementModel>(); - var doc = GlobalResource.CurrentDocument; + List<string> ret = new List<string>(); if (!GlobalResource.RevitModels.ContainsKey(type)) { return ret; } - return GlobalResource.RevitModels[type]; + var doc = GlobalResource.CurrentDocument; + var dict = GlobalResource.RevitModels.Find(x=>x.Item1 == doc.Title)?.Item2; + if (dict == null) { return ret; } + + return dict[type]; } } } -- Gitblit v1.9.3