From eb4679bfe7f2c945f3e03f6927c8fde893f7d33c Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期三, 14 八月 2024 22:56:10 +0800
Subject: [PATCH] Revit解析bug修复

---
 Service/HStation.Service.Revit.Core/04-service/01-json/RevitJsonHelper.cs |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/Service/HStation.Service.Revit.Core/04-service/01-json/RevitJsonHelper.cs b/Service/HStation.Service.Revit.Core/04-service/01-json/RevitJsonHelper.cs
index 5d7d7d5..f1b1b73 100644
--- a/Service/HStation.Service.Revit.Core/04-service/01-json/RevitJsonHelper.cs
+++ b/Service/HStation.Service.Revit.Core/04-service/01-json/RevitJsonHelper.cs
@@ -687,6 +687,18 @@
                                 {
                                     exchanger.Roughness = roughness;
                                 }
+                                if (exchanger.Length <= 0)
+                                {
+                                    exchanger.Length = exchanger.StartPosition.Distance(exchanger.EndPosition);
+                                }
+                                if (exchanger.Diameter < 0.1)
+                                {
+                                    exchanger.Diameter = 0.1;
+                                }
+                                if (exchanger.Roughness < 0.1)
+                                {
+                                    exchanger.Roughness = 0.1;
+                                }
                                 model.Exchangers.Add(exchanger);
                             }
                             break;
@@ -759,6 +771,18 @@
                                 {
                                     pipe.Roughness = roughness;
                                 }
+                                if (pipe.Length <= 0)
+                                {
+                                    pipe.Length = pipe.StartPosition.Distance(pipe.EndPosition);
+                                }
+                                if (pipe.Diameter < 0.1)
+                                {
+                                    pipe.Diameter = 0.1;
+                                }
+                                if (pipe.Roughness < 0.1)
+                                {
+                                    pipe.Roughness = 0.1;
+                                }
                                 model.Pipes.Add(pipe);
                             }
                             break;
@@ -831,6 +855,18 @@
                                 {
                                     translation.Roughness = roughness;
                                 }
+                                if (translation.Length <= 0)
+                                {
+                                    translation.Length = translation.StartPosition.Distance(translation.EndPosition);
+                                }
+                                if (translation.Diameter < 0.1)
+                                {
+                                    translation.Diameter = 0.1;
+                                }
+                                if (translation.Roughness < 0.1)
+                                {
+                                    translation.Roughness = 0.1;
+                                }
                                 model.Translations.Add(translation);
                             }
                             break;

--
Gitblit v1.9.3