| | |
| | | using Autodesk.Revit.UI;
|
| | | using DevExpress.Data.Extensions;
|
| | | using DevExpress.XtraPrinting.Native;
|
| | | using Glodon.Revit.Utility;
|
| | | using HStation.RevitDev.Model.ModelEnum;
|
| | | using HStation.RevitDev.RevitDataExport.Entity;
|
| | | using HStation.RevitDev.RevitDataExport.Entity.ElementModels;
|
| | |
| | |
|
| | | public static string LastFilePath = string.Empty;
|
| | |
|
| | | public static List<Tuple<string, Dictionary<RevitType, List<string>>>> RevitModels = |
| | | public static List<Tuple<string, Dictionary<RevitType, List<string>>>> RevitModels =
|
| | | new List<Tuple<string, Dictionary<RevitType, List<string>>>>();
|
| | |
|
| | | public static RevitType PlacingType = RevitType.RFT_Unknown;
|
| | |
| | | public static string CurrentRevitVersion = string.Empty;
|
| | |
|
| | | public static bool HideMode = false;
|
| | |
|
| | | public static bool IsOtherHidden = false;
|
| | |
|
| | | public static Dictionary<RevitType, string> DockablePanelDict => new Dictionary<RevitType, string>
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static string ParamsFilePath
|
| | | {
|
| | | get
|
| | | {
|
| | | string result = Path.Combine(DataDirectory, "Config", "familyparams.json");
|
| | | return result;
|
| | | }
|
| | | }
|
| | |
|
| | | public static string ConfigFilePath
|
| | | {
|
| | | get
|
| | | {
|
| | | string result = Path.Combine(DataDirectory, "Config", "config.json");
|
| | | return result;
|
| | | }
|
| | | }
|
| | |
|
| | | public static string SettingFilePath
|
| | | {
|
| | | get
|
| | | {
|
| | | string result = Path.Combine(DataDirectory, "Config", "setting.json");
|
| | | return result;
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | private static ConfigModel configModel = null;
|
| | | private static ConfigSettingModel configSettingModel = null;
|
| | |
|
| | | public static ConfigSettingModel ConfigSettingModel
|
| | | {
|
| | | get
|
| | | {
|
| | | if (configSettingModel != null)
|
| | | {
|
| | | return configSettingModel;
|
| | | }
|
| | | if (!File.Exists(ConfigFilePath))
|
| | | {
|
| | | return new ConfigSettingModel() { SystemType= ConfigHelper.SystemType.All };
|
| | | }
|
| | | var strConfig = File.ReadAllText(SettingFilePath);
|
| | | if (string.IsNullOrEmpty(strConfig))
|
| | | {
|
| | | return new ConfigSettingModel() { SystemType = ConfigHelper.SystemType.All };
|
| | | }
|
| | | var ret = Newtonsoft.Json.JsonConvert.DeserializeObject<ConfigSettingModel>(strConfig);
|
| | | if (ret == null)
|
| | | {
|
| | | return new ConfigSettingModel() { SystemType = ConfigHelper.SystemType.All };
|
| | | }
|
| | | configSettingModel = ret;
|
| | | return configSettingModel;
|
| | | }
|
| | | }
|
| | | public static ConfigModel ConfigModel
|
| | | {
|
| | | get
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | //var ps = elem.GetParameterByProName("是否自定义");
|
| | | //if ((type != RevitType.RFT_Others && type != RevitType.RFT_Pipe) && (ps == null || !ps.AsString().Equals("是")))
|
| | | //{
|
| | | // return;
|
| | | //}
|
| | |
|
| | | var id = elem.Id.IntegerValue.ToString();
|
| | | if (!tuples.Contains(id))
|
| | |
| | |
|
| | | foreach (var pair in dict)
|
| | | {
|
| | | var subList = pair.Value;
|
| | | ret.AddRange(subList);
|
| | | if (pair.Key != RevitType.RFT_Others)
|
| | | {
|
| | | var subList = pair.Value;
|
| | | ret.AddRange(subList);
|
| | | }
|
| | | }
|
| | |
|
| | | return ret;
|
| | | }
|
| | |
|
| | | public static List<string> GetOtherIds(this List<Tuple<string, Dictionary<RevitType, List<string>>>> tuples)
|
| | | {
|
| | | var ret = new List<string>();
|
| | |
|
| | | var dict = tuples.Find(x => x.Item1 == CurrentDocument.Title)?.Item2;
|
| | | if (dict == null) { return ret; }
|
| | |
|
| | | foreach (var pair in dict)
|
| | | {
|
| | | if (pair.Key == RevitType.RFT_Others)
|
| | | {
|
| | | var subList = pair.Value;
|
| | | ret.AddRange(subList);
|
| | | }
|
| | | }
|
| | |
|
| | | return ret;
|