Quellcode durchsuchen

mxg:空间添加面积和周长约束

mengxiangge vor 5 Jahren
Ursprung
Commit
32489b8a03

+ 6 - 0
Executer/DataCheck/Common/MBIConst.cs

@@ -4,6 +4,7 @@
  * 创建日期:2018/3/13 19:31:08
  * ==============================================================================*/
 
+using System;
 using System.IO;
 using SAGA.DotNetUtils;
 
@@ -30,5 +31,10 @@ namespace ServiceRevitLib.Common
         /// 立管开始标志[start]
         /// </summary>
         public static string StartFlag { get; private set; } = "start";
+
+        //最少空间的面积. 0.4m  削减因子: 1
+        public static readonly double SpacePerimeterTolerance = Math.Pow(0.4 * 1000 / 304.8, 2) / 1;
+        //最小空间的周长. 0.4m  削减因子: 1
+        public static readonly double SpaceAreaTolerance = (0.4 * 1000 / 304.8 * 4) / 1;
     }
 }

+ 37 - 0
Executer/DataCheck/Extend/SpaceExtend.cs

@@ -0,0 +1,37 @@
+/* ==============================================================================
+ * 功能描述:SpaceExtend  
+ * 创 建 者:Garrett
+ * 创建日期:2019/12/6 14:52:05
+ * ==============================================================================*/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Autodesk.Revit.DB.Mechanical;
+using SAGA.DotNetUtils.Extend;
+using ServiceRevitLib.Common;
+
+namespace ServiceRevitLib.Extend
+{
+    /// <summary>
+    /// SpaceExtend
+    /// </summary>
+    public static class SpaceExtend
+    {
+        /// <summary>
+        /// 手动删除的空间,仅在明细表中可见
+        /// </summary>
+        /// <param name="space"></param>
+        /// <returns></returns>
+        public static bool IsDeleteSpace(this Space space)
+        {
+            //周长
+            double perimeter = space.Perimeter;
+            //面积
+            double area = space.Area;
+            //空间比较特殊,周长为零就相当于删除
+            return (perimeter.IsZero(MBIConst.SpacePerimeterTolerance)) || (area.IsZero(MBIConst.SpaceAreaTolerance));
+        }
+    }
+}

+ 1 - 0
Executer/DataCheck/ServiceDataCheck.csproj

@@ -108,6 +108,7 @@
     <Compile Include="DataCheck.Mode\UnitCheckResult.cs" />
     <Compile Include="DataCheck.Mode\SagaCheckResult.cs" />
     <Compile Include="Extend\MepExtension.cs" />
+    <Compile Include="Extend\SpaceExtend.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="TestCommand.cs" />
     <Compile Include="Utils\DataCheckRule.cs" />

+ 32 - 0
Executer/DataExport/RevitToJBim/Extension/SpaceExtend.cs

@@ -0,0 +1,32 @@
+/* ==============================================================================
+ * 功能描述:SpaceExtend  
+ * 创 建 者:Garrett
+ * 创建日期:2019/12/6 14:52:05
+ * ==============================================================================*/
+
+using Autodesk.Revit.DB.Mechanical;
+using SAGA.DotNetUtils.Extend;
+
+namespace RevitToJBim.Extension
+{
+    /// <summary>
+    /// SpaceExtend
+    /// </summary>
+    public static class SpaceExtend
+    {
+        /// <summary>
+        /// 手动删除的空间,仅在明细表中可见
+        /// </summary>
+        /// <param name="space"></param>
+        /// <returns></returns>
+        public static bool IsDeleteSpace(this Space space)
+        {
+            //周长
+            double perimeter = space.Perimeter;
+            //面积
+            double area = space.Area;
+            //空间比较特殊,周长为零就相当于删除
+            return (perimeter.IsZero(MBIConst.SpacePerimeterTolerance)) || (area.IsZero(MBIConst.SpaceAreaTolerance));
+        }
+    }
+}

+ 24 - 0
Executer/DataExport/RevitToJBim/MBI/MBIConst.cs

@@ -0,0 +1,24 @@
+/* ==============================================================================
+ * 功能描述:MBIConst  
+ * 创 建 者:Garrett
+ * 创建日期:2019/12/6 14:56:49
+ * ==============================================================================*/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace RevitToJBim.MBI
+{
+    /// <summary>
+    /// MBIConst
+    /// </summary>
+    class MBIConst
+    {
+        //最少空间的面积. 0.4m  削减因子: 1
+        public static readonly double SpacePerimeterTolerance = Math.Pow(0.4 * 1000 / 304.8, 2) / 1;
+        //最小空间的周长. 0.4m  削减因子: 1
+        public static readonly double SpaceAreaTolerance = (0.4 * 1000 / 304.8 * 4) / 1;
+    }
+}

+ 2 - 0
Executer/DataExport/RevitToJBim/RevitToJBim.csproj

@@ -69,6 +69,7 @@
     <Compile Include="ComponentParse\ParseGrid.cs" />
     <Compile Include="ComponentParse\ParseLevel.cs" />
     <Compile Include="ComponentParse\ParseUnit.cs" />
+    <Compile Include="Extension\SpaceExtend.cs" />
     <Compile Include="Extension\SpaceExtension.cs" />
     <Compile Include="Extension\CurveLoopExtension.cs" />
     <Compile Include="Extension\GeometryElementExtension.cs" />
@@ -76,6 +77,7 @@
     <Compile Include="JsonConverter\ParameterConverter.cs" />
     <Compile Include="MbiExportCommand.cs" />
     <Compile Include="MBI\MBIBuiltInParameterName.cs" />
+    <Compile Include="MBI\MBIConst.cs" />
     <Compile Include="MBI\MBIDocument.cs" />
     <Compile Include="MBI\MBIRegexPattern.cs" />
     <Compile Include="Common\RevitIdGenerator.cs" />

BIN
RevitDlls/SAGA.DotNetUtils.dll


BIN
RevitDlls/SAGA.RevitUtils.dll