| | |
| | | |
| | | feedBackProgress?.Invoke(100, 5); |
| | | |
| | | #endregion |
| | | #endregion 第一步 临时文件处理(进度5%) |
| | | |
| | | #region 第二步 创建项目(进度 10%) |
| | | |
| | |
| | | |
| | | feedBackProgress?.Invoke(100, 10); |
| | | |
| | | #endregion |
| | | #endregion 第二步 创建项目(进度 10%) |
| | | |
| | | #region 第三步 设置地图位置(进度 20%) |
| | | |
| | |
| | | |
| | | feedBackProgress?.Invoke(100, 20); |
| | | |
| | | #endregion |
| | | #endregion 第三步 设置地图位置(进度 20%) |
| | | |
| | | #region 第四步 压缩文件解析 (进度25%) |
| | | |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | feedBackMsg?.Invoke("模型文件解析成功。。。", Color.Green); |
| | | |
| | | feedBackProgress?.Invoke(100, 25); |
| | | |
| | | #endregion |
| | | #endregion 第四步 压缩文件解析 (进度25%) |
| | | |
| | | #region 第五步 解析水力结构文件 (进度30%) |
| | | |
| | |
| | | feedBackProgress?.Invoke(100, 100); |
| | | return true; |
| | | } |
| | | var structOthersFileInfo = allFileInfoList.Find(x => x.Name == HStation.Revit.ConstParas.StructOthersFileName); |
| | | |
| | | var structRevitModel = HStation.Service.RevitParseHelper.FromJsonFile(structFileInfo.FullName, out msg); |
| | | var structRevitModel = HStation.Service.RevitParseHelper.FromJsonFile(structFileInfo.FullName, structOthersFileInfo?.FullName, out msg); |
| | | 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) |
| | | { |
| | | foreach (var revitParterPropStatus in revitParter.PropStatusList) |
| | | { |
| | | if (revitParterPropStatus.PropStatus == HStation.Revit.ePropStatus.Error) |
| | | { |
| | | hasRevitError = 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.Abnormal: |
| | | { |
| | | feedBackMsg?.Invoke($"构件编码:{revitParter.Code},构件属性:{revitParterPropStatus.PropName},异常:{revitParterPropStatus.StatusInfo} ", Color.Orange); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (hasRevitError) |
| | | { |
| | | feedBackMsg?.Invoke($"水力结构文件属性错误!!!", Color.Red); |
| | | feedBackMsg?.Invoke("项目导入结束。。。", Color.Blue); |
| | | feedBackProgress?.Invoke(100, 100); |
| | | return true; |
| | |
| | | return true; |
| | | } |
| | | |
| | | feedBackMsg?.Invoke("正在进行产品匹配...", Color.Black); |
| | | hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(hydroId); |
| | | var matchingParas = AssetsMatchingParasHelper.Create(hydroInfo); |
| | | if (AssetsMatchingHelper.Matching(matchingParas, out string error)) |
| | | { |
| | | if (AssetsMatchingParasHelper.Apply(hydroInfo, matchingParas)) |
| | | { |
| | | feedBackMsg?.Invoke("产品匹配成功。。。", Color.Green); |
| | | } |
| | | else |
| | | { |
| | | feedBackMsg?.Invoke("产品匹配失败!!!", Color.Red); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | feedBackMsg?.Invoke("产品匹配失败!!!", Color.Red); |
| | | } |
| | | hydroId = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.Save(hydroInfo); |
| | | |
| | | feedBackMsg?.Invoke("水力结构文件解析成功。。。", Color.Green); |
| | | feedBackProgress?.Invoke(100, 30); |
| | | vm.HydroID = hydroId; |
| | | |
| | | #endregion |
| | | #endregion 第五步 解析水力结构文件 (进度30%) |
| | | |
| | | #region 第六步 关联水力结构模型(进度 40%) |
| | | |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | vm.HydroRelationID = hydroRelationId; |
| | | feedBackMsg?.Invoke("关联水力结构模型成功。。。", Color.Green); |
| | | feedBackProgress?.Invoke(100, 40); |
| | | |
| | | #endregion |
| | | #endregion 第六步 关联水力结构模型(进度 40%) |
| | | |
| | | #region 第七步 上传Revit模型文件(进度 45%) |
| | | |
| | |
| | | } |
| | | |
| | | // var bimfaceId = await Yw.WinFrmUI.BimfaceHelper.UploadFile(rvtFileInfo.FullName);//上传 |
| | | //var bimfaceId = 10000878332030; //测试用例 |
| | | var bimfaceId = 10000870453147;//简单用例 |
| | | var bimfaceId = 10000878572231; //测试用例 |
| | | if (bimfaceId < 1) |
| | | { |
| | | feedBackMsg?.Invoke("Revit模型文件上传失败!!!", Color.Red); |
| | |
| | | feedBackMsg?.Invoke("解析Revit模型文件成功。。。", Color.Green); |
| | | feedBackProgress?.Invoke(100, 45); |
| | | |
| | | #endregion |
| | | #endregion 第七步 上传Revit模型文件(进度 45%) |
| | | |
| | | #region 第八步 保存Bimface文件 (进度 50%) |
| | | |
| | |
| | | feedBackMsg?.Invoke("Bimface文件保存成功。。。", Color.Green); |
| | | feedBackProgress?.Invoke(100, 50); |
| | | |
| | | #endregion |
| | | #endregion 第八步 保存Bimface文件 (进度 50%) |
| | | |
| | | #region 第九步 关联Bimface文件(进度 55%) |
| | | |
| | |
| | | feedBackMsg?.Invoke("Bimface文件关联成功。。。", Color.Green); |
| | | feedBackProgress?.Invoke(100, 55); |
| | | |
| | | #endregion |
| | | #endregion 第九步 关联Bimface文件(进度 55%) |
| | | |
| | | #region 第十步 发起bimface转换(进度 80%) |
| | | |
| | |
| | | |
| | | feedBackProgress?.Invoke(100, 80); |
| | | |
| | | #endregion |
| | | #endregion 第十步 发起bimface转换(进度 80%) |
| | | |
| | | #region 第十一步 更新Bimface文件状态(进度 100%) |
| | | |
| | |
| | | feedBackMsg?.Invoke("项目导入完成。。。", Color.Green); |
| | | return true; |
| | | |
| | | #endregion |
| | | |
| | | #endregion 第十一步 更新Bimface文件状态(进度 100%) |
| | | } |
| | | |
| | | |
| | | } |
| | | } |