From 00f80abcfbf890ab3718d960550380389c64cea3 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期三, 16 十月 2024 10:30:39 +0800 Subject: [PATCH] Revit解析修改 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs | 78 ++++++++++++++++++++------------------ 1 files changed, 41 insertions(+), 37 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs index 0f9ca13..bcd9e9b 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs @@ -1,5 +1,6 @@ 锘縰sing Castle.Core.Internal; using DevExpress.XtraEditors; +using HStation.Model; using HStation.Vmo; using static DevExpress.XtraEditors.XtraInputBox; using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window; @@ -158,54 +159,57 @@ } var structOthersFileInfo = allFileInfoList.Find(x => x.Name == HStation.Revit.ConstParas.StructOthersFileName); - var structRevitModel = HStation.Service.RevitParseHelper.FromJsonFile(structFileInfo.FullName, structOthersFileInfo?.FullName, out msg); - if (structRevitModel == null) + var structRevitModel = HStation.Service.RevitParseHelper.FromJsonFile + (structFileInfo.FullName, structOthersFileInfo?.FullName, out bool structFileResult, out List<string> structFileMsgList); + //Revit灞炴�ч敊璇鐞� + var hasRevitPropError = false; + if (structRevitModel != null) { - feedBackMsg?.Invoke($"{msg}锛侊紒锛�", Color.Red); - feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue); - feedBackProgress?.Invoke(100, 100); - return true; - } - - //Revit 灞炴�ч敊璇鐞� - var hasRevitError = false; - var allRevitParterList = structRevitModel.GetAllParters(); - foreach (var revitParter in allRevitParterList) - { - if (revitParter.PropStatusList != null && revitParter.PropStatusList.Count > 0) + var allRevitParterList = structRevitModel.GetAllParters(); + foreach (var revitParter in allRevitParterList) { - foreach (var revitParterPropStatus in revitParter.PropStatusList) + if (revitParter.PropStatusList != null && revitParter.PropStatusList.Count > 0) { - if (revitParterPropStatus.PropStatus == HStation.Revit.ePropStatus.Error) + foreach (var revitParterPropStatus in revitParter.PropStatusList) { - hasRevitError = true; - } - switch (revitParterPropStatus.PropStatus) - { - case Revit.ePropStatus.Error: - { - feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛岄敊璇細{revitParterPropStatus.StatusInfo} ", Color.Red); - } - break; + if (revitParterPropStatus.PropStatus == HStation.Revit.ePropStatus.Error) + { + hasRevitPropError = true; + } + switch (revitParterPropStatus.PropStatus) + { + case Revit.ePropStatus.Error: + { + feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛岄敊璇細{revitParterPropStatus.StatusInfo} ", Color.Red); + } + break; - case Revit.ePropStatus.Lack: - { - feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛岀己鐪侊細{revitParterPropStatus.StatusInfo} ", Color.Gray); - } - break; + case Revit.ePropStatus.Lack: + { + feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛岀己鐪侊細{revitParterPropStatus.StatusInfo} ", Color.Gray); + } + break; - case Revit.ePropStatus.Abnormal: - { - feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛屽紓甯革細{revitParterPropStatus.StatusInfo} ", Color.Orange); - } - break; + case Revit.ePropStatus.Abnormal: + { + feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛屽紓甯革細{revitParterPropStatus.StatusInfo} ", Color.Orange); + } + break; + } } } } } - if (hasRevitError) + + //瑙f瀽缁撴灉鍒ゆ柇 + if (!structFileResult) { - feedBackMsg?.Invoke($"姘村姏缁撴瀯鏂囦欢灞炴�ч敊璇紒锛侊紒", Color.Red); + structFileMsgList?.ForEach(x => feedBackMsg?.Invoke(x, Color.Red)); + } + + if (hasRevitPropError || !structFileResult) + { + feedBackMsg?.Invoke($"姘村姏缁撴瀯鏂囦欢瑙f瀽閿欒锛侊紒锛�", Color.Red); feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue); feedBackProgress?.Invoke(100, 100); return true; -- Gitblit v1.9.3