lixiaojun
2024-10-16 00f80abcfbf890ab3718d960550380389c64cea3
Revit解析修改
已修改7个文件
614 ■■■■ 文件已修改
Service/HStation.Service.Revit.Core/04-service/01-json/02-helper/RevitConnectListExtensions.cs 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Service/HStation.Service.Revit.Core/04-service/01-json/RevitJsonHelper.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Service/HStation.Service.Revit.Core/04-service/02-correct/RevitCorrectHelper.cs 471 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Service/HStation.Service.Revit.Core/04-service/03-parse/RevitParseHelper.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/04-dlg/00-core/ImportXhsProjectFileHelper.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.Designer.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Service/HStation.Service.Revit.Core/04-service/01-json/02-helper/RevitConnectListExtensions.cs
@@ -8,8 +8,6 @@
        /// <summary>
        /// 获取中心位置
        /// </summary>
        /// <param name="list">连接列表</param>
        /// <returns></returns>
        public static Model.RevitPosition GetCenterPosition(this List<Model.RevitConnect> list)
        {
            if (list == null || list.Count < 1)
@@ -23,8 +21,6 @@
        /// <summary>
        /// 获取开始连接
        /// </summary>
        /// <param name="list">连接列表</param>
        /// <returns></returns>
        public static Model.RevitConnect GetStartConnect(this List<Model.RevitConnect> list)
        {
            if (list == null || list.Count < 1)
@@ -40,25 +36,8 @@
        }
        /// <summary>
        /// 获取开始连接列表
        /// </summary>
        /// <param name="list">连接列表</param>
        /// <returns></returns>
        public static List<Model.RevitConnect> GetStartConnects(this List<Model.RevitConnect> list)
        {
            if (list == null || list.Count < 1)
            {
                return default;
            }
            var starts = list.Where(x => x.Direction == Direction.Inlet).ToList();
            return starts;
        }
        /// <summary>
        /// 获取结束连接
        /// </summary>
        /// <param name="list">连接列表</param>
        /// <returns></returns>
        public static Model.RevitConnect GetEndConnect(this List<Model.RevitConnect> list)
        {
            if (list == null || list.Count < 1)
@@ -74,10 +53,21 @@
        }
        /// <summary>
        /// 获取开始连接列表
        /// </summary>
        public static List<Model.RevitConnect> GetStartConnects(this List<Model.RevitConnect> list)
        {
            if (list == null || list.Count < 1)
            {
                return default;
            }
            var starts = list.Where(x => x.Direction == Direction.Inlet).ToList();
            return starts;
        }
        /// <summary>
        /// 获取结束连接列表
        /// </summary>
        /// <param name="list">连接列表</param>
        /// <returns></returns>
        public static List<Model.RevitConnect> GetEndConnects(this List<Model.RevitConnect> list)
        {
            if (list == null || list.Count < 1)
@@ -88,6 +78,19 @@
            return ends;
        }
        /// <summary>
        /// 获取无方向连接列表
        /// </summary>
        public static List<Model.RevitConnect> GetNoneConnects(this List<Model.RevitConnect> list)
        {
            if (list == null || list.Count < 1)
            {
                return default;
            }
            var nones = list.Where(x => x.Direction == Direction.None).ToList();
            return nones;
        }
    }
}
Service/HStation.Service.Revit.Core/04-service/01-json/RevitJsonHelper.cs
@@ -1,7 +1,4 @@
using System.IO.Pipes;
using System.Transactions;
namespace HStation.Service
namespace HStation.Service
{
    /// <summary>
    /// Revit Json辅助类
@@ -258,7 +255,12 @@
        /// <summary>
        /// 从json文件中解析
        /// </summary>
        public static Model.RevitModel FromJsonFile(string revitJsonFile, string revitOthersJsonFile, out string msg)
        public static Model.RevitModel FromJsonFile
            (
                string revitJsonFile,
                string revitOthersJsonFile,
                out string msg
            )
        {
            if (!File.Exists(revitJsonFile))
            {
Service/HStation.Service.Revit.Core/04-service/02-correct/RevitCorrectHelper.cs
@@ -10,138 +10,388 @@
        /// <summary>
        /// 修正
        /// </summary>
        public static bool Correct(this Model.RevitModel rhs, out string msg)
        public static bool Correct(this Model.RevitModel rhs, ref List<string> msgList)
        {
            if (rhs == null)
            {
                msg = "数据为空";
                return false;
            }
            if (!Zero(rhs, out msg))
            if (msgList == null)
            {
                return false;
                msgList = new List<string>();
            }
            if (!First(rhs, out msg))
            {
                return false;
            var result = true;
            if (!CorrectCollection(rhs, ref msgList))
            {//修正集合
                result = false;
            }
            if (!Exchanger(rhs, out msg))
            {
                return false;
            if (!CorrectName(rhs, ref msgList))
            {//修正名称
                result = false;
            }
            if (!Second(rhs, out msg))
            {
                return false;
            if (!CorrectExchanger(rhs, ref msgList))
            {//修正换热器
                result = false;
            }
            if (!Three(rhs, out msg))
            {
                return false;
            if (!CorrectCode(rhs, ref msgList))
            {//修正编码
                result = false;
            }
            return true;
            if (!CorrectLink(rhs, ref msgList))
            {//修正连接
                result = false;
        }
        //前提:验证合法性
        private static bool Zero(Model.RevitModel rhs, out string msg)
        {
            msg = string.Empty;
            var allWaterSourceList = rhs.GetAllSources();
            if (allWaterSourceList == null || allWaterSourceList.Count < 1)
            {
                msg = "无水源";
                return false;
            }
            var allJunctionList = rhs.GetAllJunctions();
            if (allJunctionList == null || allJunctionList.Count < 1)
            {
                msg = "无连接节点";
                return false;
            }
            return true;
            return result;
        }
        //第一步:检查集合初始化
        private static bool First(Model.RevitModel rhs, out string msg)
        //修正集合
        private static bool CorrectCollection(Model.RevitModel rhs, ref List<string> msgList)
        {
            msg = string.Empty;
            if (rhs == null)
            {
                return false;
            }
            if (msgList == null)
            {
                msgList = new List<string>();
            }
            if (rhs.Reservoirs == null)
            {
            {//水库
                rhs.Reservoirs = new List<Model.RevitReservoir>();
            }
            if (rhs.Tanks == null)
            {
            {//水池
                rhs.Tanks = new List<Model.RevitTank>();
            }
            if (rhs.Waterboxs == null)
            {
            {//水箱
                rhs.Waterboxs = new List<Model.RevitWaterbox>();
            }
            if (rhs.Junctions == null)
            {
                rhs.Waterboxs = new List<Model.RevitWaterbox>();
            {//连接节点
                rhs.Junctions = new List<Model.RevitJunction>();
            }
            if (rhs.Bluntheads == null)
            {//闷头
                rhs.Bluntheads = new List<Model.RevitBlunthead>();
            }
            if (rhs.Elbows == null)
            {
            {//弯头
                rhs.Elbows = new List<Model.RevitElbow>();
            }
            if (rhs.Threelinks == null)
            {
            {//三通
                rhs.Threelinks = new List<Model.RevitThreelink>();
            }
            if (rhs.Fourlinks == null)
            {
            {//四通
                rhs.Fourlinks = new List<Model.RevitFourlink>();
            }
            if (rhs.Meters == null)
            {
            {//水表
                rhs.Meters = new List<RevitMeter>();
            }
            if (rhs.Flowmeters == null)
            {
            {//流量计
                rhs.Flowmeters = new List<Model.RevitFlowmeter>();
            }
            if (rhs.Pressmeters == null)
            {
            {//压力表
                rhs.Pressmeters = new List<Model.RevitPressmeter>();
            }
            if (rhs.Nozzles == null)
            {
            {//喷头
                rhs.Nozzles = new List<Model.RevitNozzle>();
            }
            if (rhs.Hydrants == null)
            {
            {//消火栓
                rhs.Hydrants = new List<Model.RevitHydrant>();
            }
            if (rhs.Bluntheads == null)
            {
                rhs.Bluntheads = new List<Model.RevitBlunthead>();
            }
            if (rhs.Pipes == null)
            {
            {//管道
                rhs.Pipes = new List<Model.RevitPipe>();
            }
            if (rhs.Translations == null)
            {
            {//过渡件
                rhs.Translations = new List<Model.RevitTranslation>();
            }
            if (rhs.Exchangers == null)
            {
            {//换热器
                rhs.Exchangers = new List<RevitExchanger>();
            }
            if (rhs.Pumps == null)
            {
            {//水泵
                rhs.Pumps = new List<Model.RevitPump>();
            }
            if (rhs.Valves == null)
            {
            {//阀门
                rhs.Valves = new List<Model.RevitValve>();
            }
            return true;
        }
        //单独修复换热器
        private static bool Exchanger(Model.RevitModel rhs, out string msg)
        //修正名称
        private static bool CorrectName(Model.RevitModel rhs, ref List<string> msgList)
        {
            msg = string.Empty;
            if (rhs == null)
            {
                return false;
            }
            if (msgList == null)
            {
                msgList = new List<string>();
            }
            if (rhs.Reservoirs != null && rhs.Reservoirs.Count > 0)
            {//水库
                var reservoirNameList = rhs.Reservoirs.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var reservoir in rhs.Reservoirs)
                {
                    if (string.IsNullOrEmpty(reservoir.Name))
                    {
                        var reservoirName = Yw.Untity.UniqueHelper.CreateFromFirst("水库", reservoirNameList);
                        reservoir.Name = reservoirName;
                        reservoirNameList.Add(reservoirName);
                    }
                }
            }
            if (rhs.Tanks != null && rhs.Tanks.Count > 0)
            {//水池
                var tankNameList = rhs.Tanks.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var tank in rhs.Tanks)
                {
                    if (string.IsNullOrEmpty(tank.Name))
                    {
                        var tankName = Yw.Untity.UniqueHelper.CreateFromFirst("水池", tankNameList);
                        tank.Name = tankName;
                        tankNameList.Add(tankName);
                    }
                }
            }
            if (rhs.Waterboxs != null && rhs.Waterboxs.Count > 0)
            {//水箱
                var waterboxNameList = rhs.Waterboxs.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var waterbox in rhs.Waterboxs)
                {
                    if (string.IsNullOrEmpty(waterbox.Name))
                    {
                        var waterboxName = Yw.Untity.UniqueHelper.CreateFromFirst("水池", waterboxNameList);
                        waterbox.Name = waterboxName;
                        waterboxNameList.Add(waterboxName);
                    }
                }
            }
            if (rhs.Junctions != null && rhs.Junctions.Count > 0)
            {//连接节点
                var junctionNameList = rhs.Junctions.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var junction in rhs.Junctions)
                {
                    if (string.IsNullOrEmpty(junction.Name))
                    {
                        var junctionName = Yw.Untity.UniqueHelper.CreateFromFirst("连接节点", junctionNameList);
                        junction.Name = junctionName;
                        junctionNameList.Add(junctionName);
                    }
                }
            }
            if (rhs.Bluntheads != null && rhs.Bluntheads.Count > 0)
            {//闷头
                var bluntheadNameList = rhs.Bluntheads.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var blunthead in rhs.Bluntheads)
                {
                    if (string.IsNullOrEmpty(blunthead.Name))
                    {
                        var bluntheadName = Yw.Untity.UniqueHelper.CreateFromFirst("闷头", bluntheadNameList);
                        blunthead.Name = bluntheadName;
                        bluntheadNameList.Add(bluntheadName);
                    }
                }
            }
            if (rhs.Elbows != null && rhs.Elbows.Count > 0)
            {//弯头
                var elbowNameList = rhs.Elbows.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var elbow in rhs.Elbows)
                {
                    if (string.IsNullOrEmpty(elbow.Name))
                    {
                        var elbowName = Yw.Untity.UniqueHelper.CreateFromFirst("弯头", elbowNameList);
                        elbow.Name = elbowName;
                        elbowNameList.Add(elbowName);
                    }
                }
            }
            if (rhs.Threelinks != null && rhs.Threelinks.Count > 0)
            {//三通
                var threelinkNameList = rhs.Threelinks.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var threelink in rhs.Threelinks)
                {
                    if (string.IsNullOrEmpty(threelink.Name))
                    {
                        var threelinkName = Yw.Untity.UniqueHelper.CreateFromFirst("三通", threelinkNameList);
                        threelink.Name = threelinkName;
                        threelinkNameList.Add(threelinkName);
                    }
                }
            }
            if (rhs.Fourlinks != null && rhs.Fourlinks.Count > 0)
            {//四通
                var fourlinkNameList = rhs.Fourlinks.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var fourlink in rhs.Fourlinks)
                {
                    if (string.IsNullOrEmpty(fourlink.Name))
                    {
                        var fourlinkName = Yw.Untity.UniqueHelper.CreateFromFirst("四通", fourlinkNameList);
                        fourlink.Name = fourlinkName;
                        fourlinkNameList.Add(fourlinkName);
                    }
                }
            }
            if (rhs.Nozzles != null && rhs.Nozzles.Count > 0)
            {//喷头
                var nozzleNameList = rhs.Nozzles.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var nozzle in rhs.Nozzles)
                {
                    if (string.IsNullOrEmpty(nozzle.Name))
                    {
                        var nozzleName = Yw.Untity.UniqueHelper.CreateFromFirst("喷头", nozzleNameList);
                        nozzle.Name = nozzleName;
                        nozzleNameList.Add(nozzleName);
                    }
                }
            }
            if (rhs.Hydrants != null && rhs.Hydrants.Count > 0)
            {//消火栓
                var hydrantNameList = rhs.Hydrants.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var hydrant in rhs.Hydrants)
                {
                    if (string.IsNullOrEmpty(hydrant.Name))
                    {
                        var hydrantName = Yw.Untity.UniqueHelper.CreateFromFirst("消火栓", hydrantNameList);
                        hydrant.Name = hydrantName;
                        hydrantNameList.Add(hydrantName);
                    }
                }
            }
            if (rhs.Meters != null && rhs.Meters.Count > 0)
            {//水表
                var meterNameList = rhs.Meters.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var meter in rhs.Meters)
                {
                    if (string.IsNullOrEmpty(meter.Name))
                    {
                        var meterName = Yw.Untity.UniqueHelper.CreateFromFirst("水表", meterNameList);
                        meter.Name = meterName;
                        meterNameList.Add(meterName);
                    }
                }
            }
            if (rhs.Flowmeters != null && rhs.Flowmeters.Count > 0)
            {//流量计
                var flowmeterNameList = rhs.Flowmeters.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var flowmeter in rhs.Flowmeters)
                {
                    if (string.IsNullOrEmpty(flowmeter.Name))
                    {
                        var flowmeterName = Yw.Untity.UniqueHelper.CreateFromFirst("流量计", flowmeterNameList);
                        flowmeter.Name = flowmeterName;
                        flowmeterNameList.Add(flowmeterName);
                    }
                }
            }
            if (rhs.Pressmeters != null && rhs.Pressmeters.Count > 0)
            {//压力表
                var pressmeterNameList = rhs.Pressmeters.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var pressmeter in rhs.Pressmeters)
                {
                    if (string.IsNullOrEmpty(pressmeter.Name))
                    {
                        var pressmeterName = Yw.Untity.UniqueHelper.CreateFromFirst("压力表", pressmeterNameList);
                        pressmeter.Name = pressmeterName;
                        pressmeterNameList.Add(pressmeterName);
                    }
                }
            }
            if (rhs.Pipes != null && rhs.Pipes.Count > 0)
            {//管道
                var pipeNameList = rhs.Pipes.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var pipe in rhs.Pipes)
                {
                    if (string.IsNullOrEmpty(pipe.Name))
                    {
                        var pipeName = Yw.Untity.UniqueHelper.CreateFromFirst("管道", pipeNameList);
                        pipe.Name = pipeName;
                        pipeNameList.Add(pipeName);
                    }
                }
            }
            if (rhs.Translations != null && rhs.Translations.Count > 0)
            {//过渡件
                var translationNameList = rhs.Translations.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var translation in rhs.Translations)
                {
                    if (string.IsNullOrEmpty(translation.Name))
                    {
                        var translationName = Yw.Untity.UniqueHelper.CreateFromFirst("过渡件", translationNameList);
                        translation.Name = translationName;
                        translationNameList.Add(translationName);
                    }
                }
            }
            if (rhs.Exchangers != null && rhs.Exchangers.Count > 0)
            {//换热器
                var exchangerNameList = rhs.Exchangers.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var exchanger in rhs.Exchangers)
                {
                    if (string.IsNullOrEmpty(exchanger.Name))
                    {
                        var exchangerName = Yw.Untity.UniqueHelper.CreateFromFirst("换热器", exchangerNameList);
                        exchanger.Name = exchangerName;
                        exchangerNameList.Add(exchangerName);
                    }
                }
            }
            if (rhs.Pumps != null && rhs.Pumps.Count > 0)
            {//水泵
                var pumpNameList = rhs.Pumps.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var pump in rhs.Pumps)
                {
                    if (string.IsNullOrEmpty(pump.Name))
                    {
                        var pumpName = Yw.Untity.UniqueHelper.CreateFromFirst("水泵", pumpNameList);
                        pump.Name = pumpName;
                        pumpNameList.Add(pumpName);
                    }
                }
            }
            if (rhs.Valves != null && rhs.Valves.Count > 0)
            {//阀门
                var valveNameList = rhs.Valves.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
                foreach (var valve in rhs.Valves)
                {
                    if (string.IsNullOrEmpty(valve.Name))
                    {
                        var valveName = Yw.Untity.UniqueHelper.CreateFromFirst("阀门", valveNameList);
                        valve.Name = valveName;
                        valveNameList.Add(valveName);
                    }
                }
            }
            return true;
        }
        //修复换热器
        private static bool CorrectExchanger(Model.RevitModel rhs, ref List<string> msgList)
        {
            if (rhs == null)
            {
                return false;
            }
            if (msgList == null)
            {
                msgList = new List<string>();
            }
            var result = true;
            if (rhs.Exchangers != null && rhs.Exchangers.Count > 0)
            {
                var allParterList = rhs.GetAllParters();
@@ -149,6 +399,8 @@
                {
                    if (exchanger.ConnectList != null && exchanger.ConnectList.Count > 0)
                    {
                        #region 去除无效连接和闷头
                        foreach (var connect in exchanger.ConnectList.ToList())
                        {
                            var connectParter = allParterList.Find(x => x.Id == connect.Id);
@@ -168,18 +420,30 @@
                                    decorator.Decoration = null;
                                    decorator.Description = blunthead.Description;
                                    rhs.Decorators.Add(decorator);
                                    rhs.Bluntheads.Remove(blunthead);
                                    allParterList.Remove(connectParter);
                                }
                            }
                        }
                        #endregion
                        #region 开始连接
                        var startConnectList = exchanger.ConnectList.GetStartConnects();
                        if (startConnectList == null || startConnectList.Count < 1)
                        if (startConnectList.Count < 1)
                        {
                            msg = $"换热器:{exchanger.Id} 上游连接组件不存在";
                            return false;
                            var startConnect = exchanger.ConnectList.GetStartConnect();
                            if (startConnect != null)
                            {
                                startConnectList.Add(startConnect);
                            }
                        }
                        if (startConnectList.Count < 1)
                        {
                            msgList.Add($"换热器[{exchanger.Code}]上游连接组件不存在");
                            result = false;
                            continue;
                        }
                        var startJunction = new Model.RevitJunction();
                        startJunction.Id = Yw.Untity.UniqueHelper.CreateFromFirst("junction", allParterList.Select(x => x.Code).ToList());
@@ -212,11 +476,24 @@
                        }
                        allParterList.Add(startJunction);
                        #endregion
                        #region 结束连接
                        var endConnectList = exchanger.ConnectList.GetEndConnects();
                        if (endConnectList == null || endConnectList.Count < 1)
                        if (endConnectList.Count < 1)
                        {
                            msg = $"换热器:{exchanger.Id} 下游连接组件不存在";
                            return false;
                            var endConnect = exchanger.ConnectList.GetEndConnect();
                            if (endConnect != null)
                            {
                                endConnectList.Add(endConnect);
                            }
                        }
                        if (endConnectList.Count < 1)
                        {
                            msgList.Add($"换热器[{exchanger.Code}]下游连接组件不存在");
                            result = false;
                            continue;
                        }
                        var endJunction = new Model.RevitJunction();
                        endJunction.Id = Yw.Untity.UniqueHelper.CreateFromFirst("junction", allParterList.Select(x => x.Code).ToList());
@@ -248,16 +525,31 @@
                            }
                        }
                        allParterList.Add(endJunction);
                        #endregion
                    }
                    else
                    {
                        msgList.Add($"换热器[{exchanger.Code}]连接列表为空");
                        result = false;
                    }
                }
            }
            return true;
            return result;
        }
        //第二步:检查上下游编码
        private static bool Second(Model.RevitModel rhs, out string msg)
        //修正编码
        private static bool CorrectCode(Model.RevitModel rhs, ref List<string> msgList)
        {
            msg = string.Empty;
            if (rhs == null)
            {
                return false;
            }
            if (msgList == null)
            {
                msgList = new List<string>();
            }
            var result = true;
            var allParterList = rhs.GetAllParters();
            var allLinks = rhs.GetAllLinks();
            foreach (var link in allLinks)
@@ -265,25 +557,40 @@
                var startLinkParter = allParterList.Find(x => x.Id == link.StartCode);
                if (startLinkParter == null)
                {
                    msg = $"管段: {link.Id} 上游节点错误";
                    return false;
                    msgList.Add($"管段:[{link.Code}]上游节点错误");
                    result = false;
                }
                else
                {
                link.StartCode = startLinkParter.Code;
                }
                var endLinkParter = allParterList.Find(x => x.Id == link.EndCode);
                if (endLinkParter == null)
                {
                    msg = $"管段: {link.Id} 下游节点错误";
                    return false;
                    msgList.Add($"管段:[{link.Code}]下游节点错误");
                    result = false;
                }
                else
                {
                link.EndCode = endLinkParter.Code;
            }
            return true;
            }
            return result;
        }
        //第三步:按照水力结构进行修正
        private static bool Three(Model.RevitModel rhs, out string msg)
        //修正连接
        private static bool CorrectLink(Model.RevitModel rhs, ref List<string> msgList)
        {
            msg = string.Empty;
            if (rhs == null)
            {
                return false;
            }
            if (msgList == null)
            {
                msgList = new List<string>();
            }
            var allParterList = rhs.GetAllParters();
            var allLinks = rhs.GetAllLinks();
            foreach (var link in allLinks)
@@ -348,5 +655,7 @@
            return true;
        }
    }
}
Service/HStation.Service.Revit.Core/04-service/03-parse/RevitParseHelper.cs
@@ -8,39 +8,43 @@
        /// <summary>
        /// 从 Revit json字符串中解析
        /// </summary>
        /// <param name="revitJsonString">Revit json 字符串</param>
        /// <returns></returns>
        public static Model.RevitModel FromJsonString(string revitJsonString, string revitOthersJsonString, out string msg)
        public static Model.RevitModel FromJsonString(string revitJsonString, string revitOthersJsonString, out bool result, out List<string> msgList)
        {
            var rhs = RevitJsonHelper.FromJsonString(revitJsonString, revitOthersJsonString, out msg);
            if (rhs == null)
            result = true;
            msgList = new List<string>();
            var revitModel = RevitJsonHelper.FromJsonString(revitJsonString, revitOthersJsonString, out string msg);
            if (revitModel == null)
            {
                result = false;
                msgList.Add(msg);
                return default;
            }
            if (!rhs.Correct(out msg))
            if (!revitModel.Correct(ref msgList))
            {
                return default;
                result = false;
            }
            return rhs;
            return revitModel;
        }
        /// <summary>
        /// 从 Revit json 文件中解析
        /// </summary>
        /// <param name="revitJsonFile">Revit json 文件</param>
        /// <returns></returns>
        public static Model.RevitModel FromJsonFile(string revitJsonFile, string revitOthersJsonFile, out string msg)
        public static Model.RevitModel FromJsonFile(string revitJsonFile, string revitOthersJsonFile, out bool result, out List<string> msgList)
        {
            var rhs = RevitJsonHelper.FromJsonFile(revitJsonFile, revitOthersJsonFile, out msg);
            if (rhs == null)
            result = true;
            msgList = new List<string>();
            var revitModel = RevitJsonHelper.FromJsonFile(revitJsonFile, revitOthersJsonFile, out string msg);
            if (revitModel == null)
            {
                result = false;
                msgList.Add(msg);
                return default;
            }
            if (!rhs.Correct(out msg))
            if (!revitModel.Correct(ref msgList))
            {
                return default;
                result = false;
            }
            return rhs;
            return revitModel;
        }
WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs
@@ -1,5 +1,6 @@
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;
@@ -158,17 +159,12 @@
            }
            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)
            {
                feedBackMsg?.Invoke($"{msg}!!!", Color.Red);
                feedBackMsg?.Invoke("项目导入结束。。。", Color.Blue);
                feedBackProgress?.Invoke(100, 100);
                return true;
            }
            var structRevitModel = HStation.Service.RevitParseHelper.FromJsonFile
                (structFileInfo.FullName, structOthersFileInfo?.FullName, out bool structFileResult, out List<string> structFileMsgList);
            //Revit 属性错误处理
            var hasRevitError = false;
            var hasRevitPropError = false;
            if (structRevitModel != null)
            {
            var allRevitParterList = structRevitModel.GetAllParters();
            foreach (var revitParter in allRevitParterList)
            {
@@ -178,7 +174,7 @@
                    {
                        if (revitParterPropStatus.PropStatus == HStation.Revit.ePropStatus.Error)
                        {
                            hasRevitError = true;
                                hasRevitPropError = true;
                        }
                        switch (revitParterPropStatus.PropStatus)
                        {
@@ -203,9 +199,17 @@
                    }
                }
            }
            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;
WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/04-dlg/00-core/ImportXhsProjectFileHelper.cs
@@ -73,7 +73,7 @@
                return false;
            }
            var revitModel = HStation.Service.RevitParseHelper.FromJsonFile(jsonFileInfo.FullName, null, out msg);
            var revitModel = HStation.Service.RevitParseHelper.FromJsonFile(jsonFileInfo.FullName, null, out bool result, out List<string> msgList);
            if (revitModel == null)
            {
                feedBackMsg?.Invoke($"{msg}!!!", Color.Red);
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.Designer.cs
@@ -93,7 +93,7 @@
            ribbonControl1.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.ShowOnMultiplePages;
            ribbonControl1.ShowQatLocationSelector = false;
            ribbonControl1.ShowToolbarCustomizeItem = false;
            ribbonControl1.Size = new Size(967, 101);
            ribbonControl1.Size = new Size(967, 128);
            ribbonControl1.Toolbar.ShowCustomizeItem = false;
            ribbonControl1.ToolbarLocation = DevExpress.XtraBars.Ribbon.RibbonQuickAccessToolbarLocation.Hidden;
            // 
@@ -304,12 +304,12 @@
            tabPane1.Controls.Add(tabPageBimface);
            tabPane1.Controls.Add(tabPageQ3d);
            tabPane1.Dock = DockStyle.Fill;
            tabPane1.Location = new Point(0, 101);
            tabPane1.Location = new Point(0, 128);
            tabPane1.Name = "tabPane1";
            tabPane1.Pages.AddRange(new DevExpress.XtraBars.Navigation.NavigationPageBase[] { tabPageBimface, tabPageQ3d });
            tabPane1.RegularSize = new Size(692, 367);
            tabPane1.RegularSize = new Size(692, 340);
            tabPane1.SelectedPage = tabPageBimface;
            tabPane1.Size = new Size(692, 367);
            tabPane1.Size = new Size(692, 340);
            tabPane1.TabIndex = 1;
            tabPane1.Text = "tabPane1";
            // 
@@ -336,17 +336,17 @@
            docPnlRight.Controls.Add(controlContainerRight);
            docPnlRight.Dock = DevExpress.XtraBars.Docking.DockingStyle.Right;
            docPnlRight.ID = new Guid("cffe2560-3445-4488-83cf-b9e4b936ff18");
            docPnlRight.Location = new Point(692, 101);
            docPnlRight.Location = new Point(692, 128);
            docPnlRight.Name = "docPnlRight";
            docPnlRight.OriginalSize = new Size(275, 200);
            docPnlRight.Size = new Size(275, 532);
            docPnlRight.Size = new Size(275, 505);
            docPnlRight.Text = "属性";
            // 
            // controlContainerRight
            // 
            controlContainerRight.Location = new Point(4, 26);
            controlContainerRight.Name = "controlContainerRight";
            controlContainerRight.Size = new Size(268, 503);
            controlContainerRight.Size = new Size(268, 476);
            controlContainerRight.TabIndex = 0;
            // 
            // docPnlBottom