| | |
| | | using Castle.Core.Internal; |
| | | using DevExpress.XtraEditors; |
| | | using HStation.Model; |
| | | using HStation.Vmo; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using static DevExpress.XtraEditors.XtraInputBox; |
| | | using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | |
| | | feedBackMsg?.Invoke($"构件类型:{revitParter.Catalog},构件编码:{revitParter.Id},构件属性:{revitParterPropStatus.PropName},错误:{revitParterPropStatus.StatusInfo} ", Color.Red); |
| | | } |
| | | break; |
| | | |
| | | default: break; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | vm.HydroInfo = HStation.Hydro.TransferHelper.FromRevit |
| | | (vm.RevitModel, out List<Yw.Model.HydroParterScenePropValueInfo> allScenePropValueInfo, out List<Yw.Model.HydroDecoratorInfo> allDecoratorList, out msg); |
| | | ( |
| | | vm.RevitModel, |
| | | out List<Yw.Model.HydroParterPropStatusInfo> allPropStatusDbList, |
| | | out List<Yw.Model.HydroParterScenePropValueInfo> allScenePropValueList, |
| | | out List<Yw.Model.HydroDecoratorInfo> allDecoratorList, |
| | | out msg |
| | | ); |
| | | if (vm.HydroInfo == null) |
| | | { |
| | | feedBackMsg?.Invoke($"水力结构文件解析失败,{msg}!!!", Color.Red); |
| | |
| | | feedBackProgress?.Invoke(100, 100); |
| | | return true; |
| | | } |
| | | |
| | | var propStatusHelper = new HydroPropStatusHelper(vm.HydroInfo, allPropStatusDbList); |
| | | |
| | | feedBackMsg?.Invoke("正在进行产品匹配...", Color.Black); |
| | | var matchingParas = Yw.WinFrmUI.HydroMatchingHelper.Create(vm.HydroInfo); |
| | |
| | | } |
| | | |
| | | feedBackMsg?.Invoke("正在进行管网参数修复...", Color.Black); |
| | | vm.HydroInfo.RepairParas(out msg); |
| | | vm.HydroInfo.RepairParas(propStatusHelper, out msg); |
| | | if (string.IsNullOrEmpty(msg)) |
| | | { |
| | | feedBackMsg?.Invoke("管网参数修复完成。。。", Color.Green); |
| | |
| | | feedBackProgress?.Invoke(100, 40); |
| | | vm.HydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(vm.HydroInfo.ID); |
| | | |
| | | //属性状态 |
| | | if (allPropStatusDbList != null && allPropStatusDbList.Count > 0) |
| | | { |
| | | await BLLFactory<Yw.BLL.HydroParterPropStatusInfo>.Instance.Save(vm.HydroInfo.ID, allPropStatusDbList); |
| | | } |
| | | |
| | | //场景属性 |
| | | if (allScenePropValueList != null && allScenePropValueList.Count > 0) |
| | | { |
| | | await BLLFactory<Yw.BLL.HydroParterScenePropValueInfo>.Instance.Save(vm.HydroInfo.ID, HStation.Revit.ConstParas.Scene, allScenePropValueList); |
| | | } |
| | | |
| | | //装饰件 |
| | | if (allDecoratorList != null && allDecoratorList.Count > 0) |
| | | { |
| | | await BLLFactory<Yw.BLL.HydroDecoratorInfo>.Instance.Save(vm.HydroInfo.ID, HStation.Revit.ConstParas.Scene, allDecoratorList); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 第六步 关联水力结构模型(进度 50%) |
| | |
| | | return true; |
| | | } |
| | | |
| | | //var bimfaceId = await Yw.WinFrmUI.BimfaceHelper.UploadFile(rvtFileInfo.FullName);//正式代码 |
| | | var bimfaceId = 10000896316958;//测试用例 10000884893369 10000894297457 10000895957527 10000896316958 |
| | | var bimfaceId = await Yw.WinFrmUI.BimfaceHelper.UploadFile(rvtFileInfo.FullName);//正式代码 |
| | | //var bimfaceId = 10000899666805;//测试用例 制氮循环:10000884893369 10000896755736 10000899666805 |
| | | if (bimfaceId < 1) |
| | | { |
| | | feedBackMsg?.Invoke("Revit模型文件上传失败!!!", Color.Red); |
| | |
| | | |
| | | feedBackProgress?.Invoke(100, 60); |
| | | feedBackMsg?.Invoke("正在进行模型轻量化...", Color.Black); |
| | | //var bimfaceTranslateStatus = await Yw.WinFrmUI.BimfaceHelper.TranslateRvtFile(bimfaceId);//发起转换 |
| | | var bimfaceTranslateStatus = Yw.BIMFace.eTranslateStatus.Processing;//测试代码 |
| | | var bimfaceTranslateStatus = await Yw.WinFrmUI.BimfaceHelper.TranslateRvtFile(bimfaceId);//发起转换 |
| | | //var bimfaceTranslateStatus = Yw.BIMFace.eTranslateStatus.Processing;//测试代码 |
| | | |
| | | if (bimfaceTranslateStatus != Yw.BIMFace.eTranslateStatus.Success) |
| | | { |
| | | var dlgResult = XtraMessageBox.Show("Bimface模型轻量化需要一定的时间,是否继续等待?", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question); |
| | | if (dlgResult == DialogResult.Yes) |
| | | { |
| | | await Yw.WinFrmUI.BimfaceHelper.WaitFileTranslateStatusUntilSuccess(bimfaceId, 3000); |
| | | feedBackMsg?.Invoke("模型轻量化完成。。。", Color.Green); |
| | | } |
| | | else |
| | | { |
| | | bol = await BLLFactory<Yw.BLL.BimfaceFile>.Instance.UpdateFileStatus(vm.BimfaceFile.ID, (int)Yw.Bimface.eFileStatus.Converting); |
| | | if (bol) |
| | | { |
| | | vm.BimfaceFile.FileStatus = (int)Yw.Bimface.eFileStatus.Converting; |
| | | } |
| | | else |
| | | { |
| | | feedBackMsg?.Invoke("模型文件状态更新失败!!!", Color.Red); |
| | | } |
| | | feedBackMsg?.Invoke("跳过模型轻量化等待。。。", Color.Black); |
| | | feedBackMsg?.Invoke("项目导入结束。。。", Color.Blue); |
| | | feedBackProgress?.Invoke(100, 100); |
| | | return true; |
| | | } |
| | | await Yw.WinFrmUI.BimfaceHelper.WaitFileTranslateStatusUntilSuccess(bimfaceId, 3000); |
| | | } |
| | | else |
| | | { |
| | | feedBackMsg?.Invoke("模型轻量化完成。。。", Color.Green); |
| | | } |
| | | |
| | | feedBackMsg?.Invoke("模型轻量化完成。。。", Color.Green); |
| | | feedBackProgress?.Invoke(100, 90); |
| | | |
| | | #endregion |
| | |
| | | return true; |
| | | |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |