From 28152aec3c4ff451586615aed5cc23e26b320cae Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期五, 27 九月 2024 17:08:39 +0800
Subject: [PATCH] 组件列表修改

---
 Service/HStation.Service.Revit.Core/04-service/01-json/RevitJsonHelper.cs |   37 ++++++++++++++++++++++++++++---------
 1 files changed, 28 insertions(+), 9 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 bf1d296..6f17d2b 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
@@ -807,10 +807,28 @@
                                     pipe.EndQuality = endQuality;
                                 }
 
+                                #region 闀垮害
+
                                 if (jobject[RevitJsonProp.Length].MatchNumeric(out double length))
                                 {
-                                    pipe.Length = length;
+                                    pipe.Length = length / 1000f;
                                 }
+                                if (pipe.Length <= 0)
+                                {
+                                    pipe.Length = Math.Round(pipe.StartPosition.Distance(pipe.EndPosition) / 1000f, 2);
+                                }
+
+                                #endregion
+
+                                #region 鏉愯川
+
+                                var jobjectMaterial = jobject[RevitJsonProp.Material];
+                                if (jobjectMaterial != null)
+                                {
+                                    pipe.Material = jobjectMaterial[RevitJsonProp.Name]?.ToString();
+                                }
+
+                                #endregion
 
 
                                 #region 鐩村緞
@@ -839,10 +857,7 @@
                                 {
                                     pipe.Roughness = roughness;
                                 }
-                                if (pipe.Length <= 0)
-                                {
-                                    pipe.Length = pipe.StartPosition.Distance(pipe.EndPosition);
-                                }
+
                                 if (pipe.Diameter < 0.1)
                                 {
                                     pipe.Diameter = 500;
@@ -915,6 +930,8 @@
                                 {
                                     translation.Diameter = internalDiameter;
                                 }
+
+
                                 if (jobject[RevitJsonProp.MinorLoss].MatchNumeric(out double minorLoss))
                                 {
                                     translation.MinorLoss = minorLoss;
@@ -923,6 +940,11 @@
                                 {
                                     translation.Roughness = roughness;
                                 }
+                                if (translation.Roughness < 0.1)
+                                {
+                                    translation.Roughness = 110;
+                                }
+
                                 if (translation.Length <= 0)
                                 {
                                     translation.Length = translation.StartPosition.Distance(translation.EndPosition);
@@ -931,10 +953,7 @@
                                 {
                                     translation.Diameter = 500;
                                 }
-                                if (translation.Roughness < 0.1)
-                                {
-                                    translation.Roughness = 110;
-                                }
+
                                 model.Translations.Add(translation);
                             }
                             break;

--
Gitblit v1.9.3