| | |
| | | using 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; |
| | |
| | | } |
| | | 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) |
| | | |
| | | //解析结果判断 |
| | | if (!structFileResult) |
| | | { |
| | | feedBackMsg?.Invoke($"水力结构文件属性错误!!!", Color.Red); |
| | | structFileMsgList?.ForEach(x => feedBackMsg?.Invoke(x, Color.Red)); |
| | | } |
| | | |
| | | if (hasRevitPropError || !structFileResult) |
| | | { |
| | | feedBackMsg?.Invoke($"水力结构文件解析错误!!!", Color.Red); |
| | | feedBackMsg?.Invoke("项目导入结束。。。", Color.Blue); |
| | | feedBackProgress?.Invoke(100, 100); |
| | | return true; |