mengxiangge пре 5 година
родитељ
комит
c7e9585e2b
100 измењених фајлова са 3888 додато и 25 уклоњено
  1. 18 0
      .gitignore
  2. 13 12
      Dispatcher/Client/Client.csproj
  3. 15 2
      Dispatcher/Client/Start/RevitCmdExecutor.cs
  4. 1 1
      Dispatcher/Client/Start/ServiceMBIClientHandler.cs
  5. 3 3
      Dispatcher/Client/app.config
  6. 2 2
      Dispatcher/Client/packages.config
  7. 2 2
      Dispatcher/HttpDownload/HttpDownload.csproj
  8. 1 1
      Dispatcher/NettyClient/NettyClient.csproj
  9. 2 2
      Dispatcher/TaskDatabase/TaskDatabase.csproj
  10. 83 0
      Executer/DataCheck/CheckFactory.cs
  11. 29 0
      Executer/DataCheck/Common/MBIConst.cs
  12. 36 0
      Executer/DataCheck/Common/RegexConstPattern.cs
  13. 59 0
      Executer/DataCheck/DataCheck.Mode/CheckBase.cs
  14. 52 0
      Executer/DataCheck/DataCheck.Mode/ColumnCheck.cs
  15. 24 0
      Executer/DataCheck/DataCheck.Mode/ColumnCheckResult.cs
  16. 161 0
      Executer/DataCheck/DataCheck.Mode/ConnectorCheck.cs
  17. 23 0
      Executer/DataCheck/DataCheck.Mode/ConnectorCheckResult.cs
  18. 258 0
      Executer/DataCheck/DataCheck.Mode/ElementRangeCheck.cs
  19. 35 0
      Executer/DataCheck/DataCheck.Mode/ElementRangeCheckResult.cs
  20. 69 0
      Executer/DataCheck/DataCheck.Mode/EquipInSpaceCheck.cs
  21. 31 0
      Executer/DataCheck/DataCheck.Mode/EquipInSpaceCheckResult.cs
  22. 55 0
      Executer/DataCheck/DataCheck.Mode/EquipPartLocationCheck.cs
  23. 27 0
      Executer/DataCheck/DataCheck.Mode/EquipPartLocationCheckResult.cs
  24. 78 0
      Executer/DataCheck/DataCheck.Mode/FamilyNameCheck.cs
  25. 19 0
      Executer/DataCheck/DataCheck.Mode/FamilyNameCheckResult.cs
  26. 78 0
      Executer/DataCheck/DataCheck.Mode/ParameterIntegrityCheck.cs
  27. 20 0
      Executer/DataCheck/DataCheck.Mode/ParameterIntegrityCheckResult.cs
  28. 35 0
      Executer/DataCheck/DataCheck.Mode/ResultBase.cs
  29. 17 0
      Executer/DataCheck/DataCheck.Mode/ResultState.cs
  30. 90 0
      Executer/DataCheck/DataCheck.Mode/SagaCheck.cs
  31. 19 0
      Executer/DataCheck/DataCheck.Mode/SagaCheckResult.cs
  32. 92 0
      Executer/DataCheck/DataCheck.Mode/SystemNameCheck.cs
  33. 24 0
      Executer/DataCheck/DataCheck.Mode/SystemNameCheckResult.cs
  34. 125 0
      Executer/DataCheck/DataCheck.Mode/SystemReferEquipCheck.cs
  35. 37 0
      Executer/DataCheck/DataCheck.Mode/SystemReferEquipCheckResult.cs
  36. 45 0
      Executer/DataCheck/DataCheck.Mode/UnitCheck.cs
  37. 19 0
      Executer/DataCheck/DataCheck.Mode/UnitCheckResult.cs
  38. BIN
      Executer/DataCheck/DataCheckResource/垃圾数据检查结果输出-模版.xlsx
  39. BIN
      Executer/DataCheck/DataCheckResource/模型检查结果输出格式-模版.xlsx
  40. BIN
      Executer/DataCheck/Dlls/RevitAPI.dll
  41. BIN
      Executer/DataCheck/Dlls/RevitAPIUI.dll
  42. BIN
      Executer/DataCheck/Dlls/RevitAddInUtility.dll
  43. BIN
      Executer/DataCheck/Dlls/RevitNET.dll
  44. BIN
      Executer/DataCheck/Dlls/SAGA.DotNetUtils.dll
  45. BIN
      Executer/DataCheck/Dlls/SAGA.RevitUtils.dll
  46. 38 0
      Executer/DataCheck/Extend/DocExtend.cs
  47. 239 0
      Executer/DataCheck/Extend/ElementExtend.cs
  48. 36 0
      Executer/DataCheck/Properties/AssemblyInfo.cs
  49. 123 0
      Executer/DataCheck/ServiceDataCheck.csproj
  50. 6 0
      Executer/DataCheck/ServiceDataCheck.csproj.user
  51. 42 0
      Executer/DataCheck/TestCommand.cs
  52. 166 0
      Executer/DataCheck/Utils/DataCheckRule.cs
  53. 19 0
      Executer/DataCheck/app.config
  54. 6 0
      Executer/DataCheck/packages.config
  55. BIN
      Executer/DataExport/Dlls/RevitAPI.dll
  56. BIN
      Executer/DataExport/Dlls/RevitAPIUI.dll
  57. BIN
      Executer/DataExport/Dlls/RevitAddInUtility.dll
  58. BIN
      Executer/DataExport/Dlls/RevitNET.dll
  59. BIN
      Executer/DataExport/Dlls/SAGA.DotNetUtils.dll
  60. BIN
      Executer/DataExport/Dlls/SAGA.RevitAPI.dll
  61. BIN
      Executer/DataExport/Dlls/SAGA.RevitUtils.dll
  62. 49 0
      Executer/DataExport/JBIM.sln
  63. 96 0
      Executer/DataExport/JBIM/BimDocument.cs
  64. 74 0
      Executer/DataExport/JBIM/BimId.cs
  65. 51 0
      Executer/DataExport/JBIM/BimObject.cs
  66. 68 0
      Executer/DataExport/JBIM/Common/BimObjectUtil.cs
  67. 37 0
      Executer/DataExport/JBIM/Common/EnumExtensions.cs
  68. 37 0
      Executer/DataExport/JBIM/Common/PropertyCache.cs
  69. 34 0
      Executer/DataExport/JBIM/Common/TypeDefinitonAttribute.cs
  70. 25 0
      Executer/DataExport/JBIM/Common/TypeDefinitonUtil.cs
  71. 34 0
      Executer/DataExport/JBIM/Component/BoundarySegment.cs
  72. 27 0
      Executer/DataExport/JBIM/Component/Column.cs
  73. 38 0
      Executer/DataExport/JBIM/Component/ComponentObject.cs
  74. 61 0
      Executer/DataExport/JBIM/Component/Connector.cs
  75. 26 0
      Executer/DataExport/JBIM/Component/Door.cs
  76. 57 0
      Executer/DataExport/JBIM/Component/Duct.cs
  77. 30 0
      Executer/DataExport/JBIM/Component/EquipPart.cs
  78. 31 0
      Executer/DataExport/JBIM/Component/Equipment.cs
  79. 24 0
      Executer/DataExport/JBIM/Component/Grid.cs
  80. 25 0
      Executer/DataExport/JBIM/Component/Level.cs
  81. 25 0
      Executer/DataExport/JBIM/Component/MepSystem.cs
  82. 22 0
      Executer/DataExport/JBIM/Component/MepSystemType.cs
  83. 30 0
      Executer/DataExport/JBIM/Component/OtherJoinObject.cs
  84. 29 0
      Executer/DataExport/JBIM/Component/Parameter.cs
  85. 41 0
      Executer/DataExport/JBIM/Component/ParameterDefinition.cs
  86. 42 0
      Executer/DataExport/JBIM/Component/Pipe.cs
  87. 27 0
      Executer/DataExport/JBIM/Component/Space.cs
  88. 25 0
      Executer/DataExport/JBIM/Component/Unit.cs
  89. 22 0
      Executer/DataExport/JBIM/Component/VirtualWall.cs
  90. 36 0
      Executer/DataExport/JBIM/Component/VisibleComponentObject.cs
  91. 26 0
      Executer/DataExport/JBIM/Component/Wall.cs
  92. 24 0
      Executer/DataExport/JBIM/Component/Window.cs
  93. 36 0
      Executer/DataExport/JBIM/Definition/ConnectorShape.cs
  94. 46 0
      Executer/DataExport/JBIM/Definition/GeometryLocation.cs
  95. 80 0
      Executer/DataExport/JBIM/Definition/TypeDefinition.cs
  96. 40 0
      Executer/DataExport/JBIM/Definition/XYZ.cs
  97. 19 0
      Executer/DataExport/JBIM/Geometry/GeometryObject.cs
  98. 116 0
      Executer/DataExport/JBIM/JBIM.csproj
  99. 6 0
      Executer/DataExport/JBIM/JBIM.csproj.user
  100. 0 0
      Executer/DataExport/JBIM/Properties/AssemblyInfo.cs

+ 18 - 0
.gitignore

@@ -3,3 +3,21 @@
 ################################################################################
 
 /.vs
+/Dispatcher/Client/obj
+/Dispatcher/HttpDownload/obj
+/Dispatcher/TaskDatabase/obj
+/Dispatcher/NettyClient/obj
+/Executer/DataCheck/obj
+/Executer/DataExport/.vs/
+/Executer/DataExport/JBIM/bin
+/Executer/DataExport/JBIM/obj
+/Executer/DataExport/packages
+/Executer/DataExport/RevitExport/bin
+/Executer/DataExport/RevitExport/obj
+/Executer/DataExport/RevitToJBim/bin
+/Executer/DataExport/RevitToJBim/obj
+/OutputDll
+/packages
+/Starter/.vs/ExportStart/v15
+/Starter/bin
+/Starter/obj

+ 13 - 12
Dispatcher/Client/Client.csproj

@@ -12,12 +12,13 @@
     <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <Deterministic>true</Deterministic>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>..\OutputDll\</OutputPath>
+    <OutputPath>..\..\OutputDll\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
@@ -43,8 +44,8 @@
     <Reference Include="DotNetty.Transport, Version=0.6.0.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
       <HintPath>..\packages\DotNetty.Transport.0.6.0\lib\net45\DotNetty.Transport.dll</HintPath>
     </Reference>
-    <Reference Include="Google.Protobuf, Version=3.2.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
-      <HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
+    <Reference Include="Google.Protobuf, Version=3.8.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\Google.Protobuf.3.8.0\lib\net45\Google.Protobuf.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Configuration, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
       <HintPath>..\packages\Microsoft.Extensions.Configuration.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll</HintPath>
@@ -61,8 +62,8 @@
     <Reference Include="Microsoft.Extensions.Logging, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
       <HintPath>..\packages\Microsoft.Extensions.Logging.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.dll</HintPath>
     </Reference>
-    <Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
+    <Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\Microsoft.Extensions.Logging.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Options, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
       <HintPath>..\packages\Microsoft.Extensions.Options.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll</HintPath>
@@ -125,6 +126,13 @@
     <Compile Include="TaskHandler.cs" />
   </ItemGroup>
   <ItemGroup>
+    <None Include="app.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Readme.txt" />
+  </ItemGroup>
+  <ItemGroup>
     <ProjectReference Include="..\HttpDownload\HttpDownload.csproj">
       <Project>{9f423033-98a9-4b6b-9bb1-f1aa8c648a02}</Project>
       <Name>HttpDownload</Name>
@@ -138,12 +146,5 @@
       <Name>TaskDatabase</Name>
     </ProjectReference>
   </ItemGroup>
-  <ItemGroup>
-    <None Include="app.config" />
-    <None Include="packages.config" />
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="Readme.txt" />
-  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 15 - 2
Dispatcher/Client/Start/RevitCmdExecutor.cs

@@ -6,6 +6,8 @@
 
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
 using System.Windows.Forms;
 
 namespace Client.Start
@@ -21,8 +23,19 @@ namespace Client.Start
             //实体类传入参数、参考楼层列表
             //执行方法,返回执行结果 
             Console.WriteLine("准备执行命令");
-
-            string msg = null;
+            Process process=new Process();//AppDomain.CurrentDomain.BaseDirectory +
+            process.StartInfo.FileName =  "ExportStart.exe";//执行的exe路径
+            process.StartInfo.UseShellExecute = false;//不显示shell
+            process.StartInfo.CreateNoWindow = true;//不创建窗口
+            process.StartInfo.RedirectStandardInput = true;//打开流输入
+            process.StartInfo.RedirectStandardOutput = true;//打开流输出
+            process.StartInfo.RedirectStandardError = true;//打开错误流
+            process.StartInfo.Arguments = "(" + revitCmd +  " \"" + filePathList.First() + "\")";//输入参数,多个参数使用空间分割,如果一个参数包含空格,使用""包括此参数
+            process.Start();//执行
+            string msg = process.StandardOutput.ReadToEnd();//读取输出
+            process.WaitForExit();//等待执行完成
+            process.Close();//结束
+            
             MessageBox.Show("命令执行完成 ");
 
             return msg;

+ 1 - 1
Dispatcher/Client/Start/ServiceMBIClientHandler.cs

@@ -19,7 +19,7 @@ namespace Client.Start
         private static ClientApp m_Client;
         public static void Start()
         {
-            m_Client = new ClientApp("172.16.0.131", 6666, "E:\\", 3, new RevitCmdExecutor(), 5);
+            m_Client = new ClientApp("192.168.20.225", 6666, "E:\\", 3, new RevitCmdExecutor(), 5);
             m_Client.Start();
             //Console.ReadKey();
         }

+ 3 - 3
Dispatcher/Client/app.config

@@ -8,7 +8,7 @@
       </dependentAssembly>
       <dependentAssembly>
         <assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-3.2.0.0" newVersion="3.2.0.0" />
+        <bindingRedirect oldVersion="0.0.0.0-3.8.0.0" newVersion="3.8.0.0" />
       </dependentAssembly>
       <dependentAssembly>
         <assemblyIdentity name="Microsoft.Extensions.Logging" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -16,7 +16,7 @@
       </dependentAssembly>
       <dependentAssembly>
         <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
+        <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
       </dependentAssembly>
       <dependentAssembly>
         <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -68,4 +68,4 @@
       </dependentAssembly>
     </assemblyBinding>
   </runtime>
-</configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /></startup></configuration>

+ 2 - 2
Dispatcher/Client/packages.config

@@ -3,13 +3,13 @@
   <package id="DotNetty.Buffers" version="0.6.0" targetFramework="net461" />
   <package id="DotNetty.Common" version="0.6.0" targetFramework="net461" />
   <package id="DotNetty.Transport" version="0.6.0" targetFramework="net461" />
-  <package id="Google.Protobuf" version="3.2.0" targetFramework="net461" />
+  <package id="Google.Protobuf" version="3.8.0" targetFramework="net461" />
   <package id="Microsoft.Extensions.Configuration" version="2.2.0" targetFramework="net461" />
   <package id="Microsoft.Extensions.Configuration.Abstractions" version="2.2.0" targetFramework="net461" />
   <package id="Microsoft.Extensions.Configuration.Binder" version="2.2.0" targetFramework="net461" />
   <package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.2.0" targetFramework="net461" />
   <package id="Microsoft.Extensions.Logging" version="1.1.1" targetFramework="net461" />
-  <package id="Microsoft.Extensions.Logging.Abstractions" version="1.1.1" targetFramework="net461" />
+  <package id="Microsoft.Extensions.Logging.Abstractions" version="2.2.0" targetFramework="net461" />
   <package id="Microsoft.Extensions.Options" version="2.2.0" targetFramework="net461" />
   <package id="Microsoft.Extensions.Primitives" version="2.2.0" targetFramework="net461" />
   <package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net461" />

+ 2 - 2
Dispatcher/HttpDownload/HttpDownload.csproj

@@ -17,7 +17,7 @@
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>..\OutputDll\</OutputPath>
+    <OutputPath>..\..\OutputDll\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
@@ -25,7 +25,7 @@
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
+    <OutputPath>..\..\OutputDll\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>

+ 1 - 1
Dispatcher/NettyClient/NettyClient.csproj

@@ -17,7 +17,7 @@
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>..\OutputDll\</OutputPath>
+    <OutputPath>..\..\OutputDll\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>

+ 2 - 2
Dispatcher/TaskDatabase/TaskDatabase.csproj

@@ -17,7 +17,7 @@
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>..\OutputDll\</OutputPath>
+    <OutputPath>..\..\OutputDll\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
@@ -25,7 +25,7 @@
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
+    <OutputPath>..\..\OutputDll\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>

+ 83 - 0
Executer/DataCheck/CheckFactory.cs

@@ -0,0 +1,83 @@
+/* ==============================================================================
+ * 功能描述:CheckFactory  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:26:56
+ * ==============================================================================*/
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using ServiceRevitLib.Mode;
+using Autodesk.Revit.DB;
+using ServiceRevitLib.Extend;
+
+namespace ServiceRevitLib
+{
+    /// <summary>
+    /// CheckFactory
+    /// </summary>
+    public class CheckFactory:ResultBase
+    {
+        public CheckFactory()
+        {
+            Content=new List<CheckBase>();
+        }
+
+      
+
+        #region 序列化的属性
+
+        public List<CheckBase> Content { get; set; }
+
+        public string FloorName { get; set; }
+
+        #endregion
+
+        #region Method
+        /// <summary>
+        /// 由传入字符串获取检查项
+        /// 传入的检查列表使用“,”进行分割
+        /// </summary>
+        /// <param name="checkItemStrs"></param>
+        public void SetCheckItems(string str)
+        {
+            var checkItemStrs= str.Split(',');
+            var nameSpace = typeof(CheckBase).Namespace;
+            foreach (string itemStr in checkItemStrs)
+            {
+                //子类与父类应该使用同一命名空间;如果为Program+BaseClass格式,会出错; 如果出现此情况,请更改方法
+                string fullPath = nameSpace + "." + itemStr;
+                Assembly tempAsembly = Assembly.GetExecutingAssembly();
+                var check = (tempAsembly.CreateInstance(fullPath)) as CheckBase;
+
+                Content.Add(check);
+            }
+        }
+
+        public void Check(Document doc)
+        {
+            FloorName = doc.PathName;
+            //Document doc = DocumentUtils.GetDocument(path);
+            try
+            {
+                Content.ForEach(t => t.SetDoc(doc));
+                Content.ForEach(t => t.Check());
+            }
+            catch (Exception e)
+            {
+                ResultMsg = e.Message;
+                Result = ResultState.Failure;
+            }
+            finally
+            {
+                //doc.CloseExt();
+            }
+        }
+
+        #endregion
+
+    }
+}

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

@@ -0,0 +1,29 @@
+/* ==============================================================================
+ * 功能描述:MBIConst  
+ * 创 建 者:Garrett
+ * 创建日期:2018/3/13 19:31:08
+ * ==============================================================================*/
+
+using System.IO;
+using SAGA.DotNetUtils;
+
+namespace ServiceRevitLib.Common
+{
+    /// <summary>
+    /// MBIConst
+    /// </summary>
+    public class MBIConst
+    {
+        
+        public static readonly string MBIResourcePath = Path.Combine(AppBaseInfo.DllRunPath, "MBIResource");
+
+        /// <summary>
+        /// 设备本地编码
+        /// </summary>
+        public readonly static string EquipLocalID = "设备本地编码";
+        /// <summary>
+        /// 设备本地名称
+        /// </summary>
+        public readonly static string EquipLocalName = "设备本地名称";
+    }
+}

+ 36 - 0
Executer/DataCheck/Common/RegexConstPattern.cs

@@ -0,0 +1,36 @@
+/* ==============================================================================
+ * 功能描述:RegexPatten  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/29 14:12:17
+ * ==============================================================================*/
+
+namespace ServiceRevitLib.Common
+{
+    /// <summary>
+    /// RegexPatten
+    /// </summary>
+    class RegexConstPattern
+    {
+        public const string IsSpaceId = @"^Si\S*";
+        public const string IsEquipId = @"^Eq\S*";
+        public const string IsEquipPartId = @"^Ec\S*";
+        public const string IsBeaconId = @"^VOBc\S*";
+        
+
+        public const string IsEquip = @"^[A-Z]{4}\s*-\s*\S*";
+        public const string IsEquipPart = @"^[A-Z]{6}\s*-\s*\S*";
+        public const string IsBeacon = @"^Beacon$";
+
+        public const string IsMBILevel = @"^([BF][1-9]\d*M?\d?|RFM?\d?)$";
+        public const string IsMBIView = @"^([BF][1-9]\d*M?\d?|RFM?\d?)-saga$";
+        public const string IsSandwich = @"^([BF][1-9]\d*M\d?|RFM\d?)$";
+
+        public const string IsRF = @"^RF(-saga)?$";
+        public const string IsRFM = @"^RFM\d*$";
+        public const string IsOnground = @"^F\s*";
+        public const string IsUnderground = @"^B\s*";
+
+        public const string IsPhoneNumber = @"^1[3|4|5|7|8][0-9]\d{8}$";
+
+    }
+}

+ 59 - 0
Executer/DataCheck/DataCheck.Mode/CheckBase.cs

@@ -0,0 +1,59 @@
+/* ==============================================================================
+ * 功能描述:CheckBase  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:01:26
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using Autodesk.Revit.DB;
+using Newtonsoft.Json;
+
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// CheckBase
+    /// </summary>
+    public class CheckBase:ResultBase
+    {
+        public CheckBase()
+        {
+            Content=new List<ResultBase>();
+        }
+        private string m_Name;
+        /// <summary>
+        /// 检查项名称
+        /// </summary>
+        public string Name
+        {
+            get { return this.GetType().Name; }
+        }
+
+
+        public List<ResultBase> Content { get; set; }
+        /// <summary>
+        /// 关联表的名称
+        /// </summary>
+        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
+        public string ReferenceSheet { get; set; }
+
+
+        #region Method
+        
+        protected Document m_Doc { get; set; }
+
+        public void SetDoc(Document doc)
+        {
+            m_Doc = doc;
+        }
+        public virtual void Check()
+        {
+            if(m_Doc==null)throw new NullReferenceException();
+
+            Console.WriteLine(this.Name + "Checked");
+        }
+
+        #endregion
+    }
+}

+ 52 - 0
Executer/DataCheck/DataCheck.Mode/ColumnCheck.cs

@@ -0,0 +1,52 @@
+/* ==============================================================================
+ * 功能描述:SagaCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:09:09
+ * ==============================================================================*/
+
+using System;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using SAGA.DotNetUtils.Extend;
+using ServiceRevitLib.Common;
+using SAGA.RevitUtils.Extends;
+using ServiceRevitLib.Extend;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheck
+    /// </summary>
+    class ColumnCheck : CheckBase
+    {
+        public override void Check()
+        {
+            base.Check();
+
+            #region
+
+            var document = m_Doc;
+            var elements = document.GetElements<FamilyInstance>(BuiltInCategory.OST_StructuralColumns);
+            foreach (FamilyInstance fi in elements)
+            {
+                var result = new ColumnCheckResult();
+                result.FamilyName = fi.GetFamilyName();
+                result.Id = fi.Id.ToString();
+                var roomBoundaries = fi.GetParameterInteger(BuiltInParameter.WALL_ATTR_ROOM_BOUNDING);
+                if (roomBoundaries == 1)
+                {
+                    result.Result = ResultState.Success;
+                }
+                else
+                {
+                    result.Result = ResultState.Failure;
+                    result.ResultMsg = "柱的房间边界属性 未勾选";
+                }
+                Content.Add(result);
+            }
+            #endregion
+
+        }
+    }
+}

+ 24 - 0
Executer/DataCheck/DataCheck.Mode/ColumnCheckResult.cs

@@ -0,0 +1,24 @@
+/* ==============================================================================
+ * 功能描述:SagaCheckResult  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:20:46
+ * ==============================================================================*/
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheckResult
+    /// </summary>
+    class ColumnCheckResult : ResultBase
+    {
+        /// <summary>
+        /// id
+        /// </summary>
+        public string Id { get; set; }
+        /// <summary>
+        /// 族名称
+        /// </summary>
+        public string FamilyName { get; set; }
+        
+    }
+}

+ 161 - 0
Executer/DataCheck/DataCheck.Mode/ConnectorCheck.cs

@@ -0,0 +1,161 @@
+/* ==============================================================================
+ * 功能描述:SagaCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:09:09
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using SAGA.DotNetUtils.Extend;
+using ServiceRevitLib.Common;
+using SAGA.RevitUtils.Extends;
+using SAGA.RevitUtils.MEP;
+using ServiceRevitLib.Extend;
+using ServiceRevitLib.Utils;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheck
+    /// </summary>
+    class ConnectorCheck : CheckBase
+    {
+        public ConnectorCheck()
+        {
+            ReferenceSheet = "参考-连接件对照表";
+        }
+        public override void Check()
+        {
+            base.Check();
+
+            #region
+
+            bool unitResult = true;
+            m_ProDefineConnectors = GetPreDefineConnectors();
+            var elements = m_Doc.GetEqEcElements();
+
+            foreach (var element in elements)
+            {
+                //检查设备或者部件
+                var result = GetCheckResult(element);
+                if (result == null) continue;
+                Content.Add(result);
+            }
+            #endregion
+
+        }
+        
+
+        private string m_HaveConnectorSing = "√";
+        private List<DCR_Connector> m_ProDefineConnectors;
+
+        public List<DCR_Connector> GetPreDefineConnectors()
+        {
+            var list = new List<DCR_Connector>();
+            var alllist = DataCheckRule.GetPreDefineConnectors();
+            foreach (DCR_Connector connector in alllist)
+            {
+                var pipeType = connector.PipeConnector;
+                var hvacType = connector.HvacConnector;
+                if (pipeType == m_HaveConnectorSing || hvacType == m_HaveConnectorSing)
+                {
+                    list.Add(connector);
+                    if (connector.PName.IsNotNullEmpty() && connector.PCode.IsNotNullEmpty())
+                    {
+                        //部件单独提出来当做一项
+                        var pconnector = new DCR_Connector()
+                        {
+                            Code = connector.PCode,
+                            Name = connector.Name,
+                            PipeConnector = connector.PipeConnector,
+                            HvacConnector = connector.HvacConnector
+                        };
+                        list.Add(pconnector);
+                    }
+                }
+            }
+            return list;
+        }
+        /// <summary>
+        /// 获取检测结果
+        /// </summary>
+        /// <param name="fi"></param>
+        /// <returns></returns>
+        private ConnectorCheckResult GetCheckResult(Element element)
+        {
+            if (element == null) return null;
+            var result = new ConnectorCheckResult();
+            var code = element.GetFamilyCode();
+            var defineConType = GetDefineConType(code);
+            if (defineConType == null) return null;
+            result.FamilyName = element.GetFamilyName();
+            result.Id = element.Id.ToString();
+            result.Result = ResultState.Success;
+            CheckConType(result, element, defineConType.Item1);
+            CheckConType(result, element, defineConType.Item2);
+            return result;
+        }
+        /// <summary>
+        /// 获取定义的风和水连接件类型
+        /// </summary>
+        /// <param name="code"></param>
+        /// <returns></returns>
+        private Tuple<Domain, Domain> GetDefineConType(string code)
+        {
+            var item = m_ProDefineConnectors.FirstOrDefault(t => t.Code == code);
+            if (item == null) return null;
+            var pipeType = item.PipeConnector;
+            var hvacType = item.HvacConnector;
+
+            var pipeConType = pipeType == m_HaveConnectorSing ? Domain.DomainPiping : Domain.DomainUndefined;
+            var hvacConType = hvacType == m_HaveConnectorSing ? Domain.DomainHvac : Domain.DomainUndefined;
+            return new Tuple<Domain, Domain>(pipeConType, hvacConType);
+        }
+        /// <summary>
+        /// 检查连接件类型是否存在
+        /// </summary>
+        /// <param name="result"></param>
+        /// <param name="domain"></param>
+        private void CheckConType(ConnectorCheckResult result, Element fi, Domain domain)
+        {
+            if (domain != Domain.DomainUndefined)
+            {
+                var connectors = fi.GetConnectors(domain);
+                var domainStr = DomainToString(domain);
+                if (connectors.Any())
+                {
+                    if (connectors.All(t => t.IsConnected)) return;
+                    result.Result = ResultState.Failure;
+                    result.ResultMsg += $"发现 {domainStr}连接件未连接;";
+                }
+                else
+                {
+                    result.Result = ResultState.Failure;
+                    result.ResultMsg += $"缺少 {domainStr} 连接件;";
+                }
+            }
+        }
+
+        private string DomainToString(Domain domain)
+        {
+            string str = "";
+            switch (domain)
+            {
+                case Domain.DomainPiping:
+                    str = "水管";
+                    break;
+                case Domain.DomainHvac:
+                    str = "风管";
+                    break;
+                default:
+                    str = "未知";
+                    break;
+
+            }
+            return str;
+        }
+    }
+}

+ 23 - 0
Executer/DataCheck/DataCheck.Mode/ConnectorCheckResult.cs

@@ -0,0 +1,23 @@
+/* ==============================================================================
+ * 功能描述:SagaCheckResult  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:20:46
+ * ==============================================================================*/
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheckResult
+    /// </summary>
+    class ConnectorCheckResult : ResultBase
+    {
+        /// <summary>
+        /// id
+        /// </summary>
+        public string Id { get; set; }
+        /// <summary>
+        /// 族名称
+        /// </summary>
+        public string FamilyName { get; set; }
+    }
+}

+ 258 - 0
Executer/DataCheck/DataCheck.Mode/ElementRangeCheck.cs

@@ -0,0 +1,258 @@
+/* ==============================================================================
+ * 功能描述:SagaCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:09:09
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using Autodesk.Revit.DB.Mechanical;
+using SAGA.DotNetUtils.Extend;
+using ServiceRevitLib.Common;
+using SAGA.RevitUtils.Extends;
+using ServiceRevitLib.Extend;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheck
+    /// </summary>
+    class ElementRangeCheck : CheckBase
+    {
+        #region 序列化属性
+        private double m_Redundant = 500;
+        /// <summary>
+        /// 高度冗余
+        /// </summary>
+        public double Redundant
+        {
+            get { return m_Redundant; }
+            set { m_Redundant = value; }
+        }
+
+
+        private double m_baseLevel;
+        /// <summary>
+        /// 底部标高
+        /// </summary>
+        public double BaseLevel
+        {
+            get { return m_baseLevel; }
+        }
+
+        private List<double> m_topLevels = new List<double>();
+
+        /// <summary>
+        /// 顶部标高(夹层可能涉及多个顶)
+        /// </summary>
+        public string TopLevels
+        {
+            get { return string.Join(";", m_topLevels); }
+        }
+
+        #endregion
+        public override void Check()
+        {
+            base.Check();
+
+            #region
+
+            var document = m_Doc;
+            if (!SetFloorBaseTopRange()) return;
+            var elements = document.GetAllElements();
+            foreach (var element in elements)
+            {
+                var result = GetCheckResult(element);
+                if (result != null)
+                    Content.Add(result);
+            }
+
+
+            #endregion
+        }
+
+        /// <summary>
+        /// 设置当前楼层底部和顶部范围
+        /// </summary>
+        /// <param name="doc"></param>
+        /// <param name="result"></param>
+        private bool SetFloorBaseTopRange()
+        {
+            bool rt = true;
+            var document = m_Doc;
+            try
+            {
+                var sagaPlans = document.GetElements<ViewPlan>()
+                    .Where(t => t.ViewType == ViewType.FloorPlan && t.Name.Contains("-saga")).ToList();
+                var curFloor = sagaPlans.FirstOrDefault();
+                if (sagaPlans.Count != 1 || curFloor == null)
+                {
+                    Result = ResultState.Failure;
+                    ResultMsg = "Saga标记不合法,请修正后再进行检查";
+
+                    return false;
+                }
+
+                //设置楼层底部高度
+                m_baseLevel = curFloor.GenLevel.Elevation.FromApi().Round(2);
+
+                //设置楼层顶部高度
+                var levels = m_Doc.GetLevels();
+                var mbiLevels = levels.Where(t => Regex.IsMatch(t.Name, $"{RegexConstPattern.IsMBILevel}") && t.Elevation.IsThan(m_baseLevel)).ToList();
+                foreach (Level level in mbiLevels)
+                {
+                    m_topLevels.Add(level.Elevation.FromApi().Round(2));
+                    if (!Regex.IsMatch(level.Name, $"{RegexConstPattern.IsSandwich}"))
+                    {
+                        break;
+                    }
+                }
+                //当前层为屋顶或屋顶夹层时,顶部限制设置为正无穷
+                if (Regex.IsMatch(curFloor.GenLevel.Name, $"{RegexConstPattern.IsRF}|{RegexConstPattern.IsRFM}"))
+                {
+                    m_topLevels.Add(double.MaxValue);
+                }
+
+
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e);
+                rt = false;
+            }
+            return rt;
+        }
+
+        /// <summary>
+        /// 获取检测结果
+        /// </summary>
+        /// <param name="element"></param>
+        /// <returns></returns>
+        private ElementRangeCheckResult GetCheckResult(Element element)
+        {
+            var result = new ElementRangeCheckResult();
+            result.Id = element.Id.ToString();
+            result.FamilyName = element.GetFamilyName();
+            try
+            {
+                double zb = 0, zt = 0;
+                bool rb = false, rt = false;
+                //需要识别判定的构件
+                DCElementType type = DCElementType.None;
+                bool isBoxInst = false;
+                if (element is Wall wall)
+                {
+                    isBoxInst = true;
+                    zb = wall.GetBaseStaticHeight();
+                    zt = wall.GetTopStaticHeight();
+                    type = DCElementType.Wall;
+                }
+                else if (element.IsSpace())
+                {
+                    var space = element as Space;
+                    isBoxInst = true;
+                    zb = space.GetBaseStaticHeight();
+                    zt = space.GetTopStaticHeight();
+                    type = DCElementType.Space;
+                }
+                else if (element is FamilyInstance)
+                {
+                    if (element.IsAllColumn())
+                    {
+                        var fi = element as FamilyInstance;
+                        isBoxInst = true;
+                        zb = fi.GetBaseStaticHeight();
+                        zt = fi.GetTopStaticHeight();
+                        type = DCElementType.Column;
+                    }
+                    else if (element.IsEquipment() || element.IsEquipmentPart() || element.IsBeacon())
+                    {
+                        zb = element.GetLocationPointMBIXYZ().Z;
+                        type = GetRType(element);
+                    }
+                }
+
+                if (type==DCElementType.None) return null;
+                
+                //冗余,使用时,统一使用单位mm
+                double w = Redundant;
+                zb = zb.FromApi().Round(2);
+                zt = zt.FromApi().Round(2);
+                //构件类型
+                result.Type = type.GetDescription();
+                if (isBoxInst)
+                {
+                    rb = zb.IsBetween(m_baseLevel - w, m_baseLevel);
+                    rt = m_topLevels.Any(t => zt.IsBetween(t - w, t));
+                    string ttip = rb ? "" : "底部";
+                    string ttop = rt ? "" : rb ? "和顶部" : "顶部";
+                    result.HeightRange = $"{zb},{zt}";
+                    result.Result = (rb && rt)?ResultState.Success:ResultState.Failure;
+                    result.ResultMsg = rb && rt ? "" : $"构件范围不满足要求;请检查构件{ttip}{ttop}";
+                }
+                else
+                {
+                    rb = m_topLevels.Any(t => zb.IsBetween(m_baseLevel, t));
+                    result.HeightRange = $"{zb}";
+                    result.Result = (rb) ? ResultState.Success : ResultState.Failure;
+                    result.ResultMsg = rb? "" : $"构件范围不满足要求;请检查构件位置";
+                }
+            }
+            catch (Exception e)
+            {
+                result.Result = ResultState.Failure;
+                result.ResultMsg = "构件范围检查异常";
+            }
+
+
+            return result;
+        }
+
+        /// <summary>
+        /// 获取构件类型
+        /// </summary>
+        /// <param name="fi"></param>
+        /// <returns></returns>
+        private DCElementType GetRType(Element fi)
+        {
+            DCElementType name = DCElementType.None;
+            if (fi.IsEquipment())
+            {
+                name = DCElementType.Equipment;
+            }
+            else if (fi.IsEquipmentPart())
+            {
+                name = DCElementType.EuipmentPart;
+            }
+            else if (fi.IsBeacon())
+            {
+                name = DCElementType.Beacon;
+            }
+            return name;
+        }
+        /// <summary>
+        /// DCElementType
+        /// </summary>
+        public enum DCElementType
+        {
+            [Description("未知")]
+            None,
+            [Description("墙")]
+            Wall,
+            [Description("柱")]
+            Column,
+            [Description("空间")]
+            Space,
+            [Description("设备")]
+            Equipment,
+            [Description("部件")]
+            EuipmentPart,
+            [Description("信标")]
+            Beacon
+        }
+    }
+}

+ 35 - 0
Executer/DataCheck/DataCheck.Mode/ElementRangeCheckResult.cs

@@ -0,0 +1,35 @@
+/* ==============================================================================
+ * 功能描述:SagaCheckResult  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:20:46
+ * ==============================================================================*/
+
+using Newtonsoft.Json;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheckResult
+    /// </summary>
+    class ElementRangeCheckResult : ResultBase
+    {
+        /// <summary>
+        /// id
+        /// </summary>
+        public string Id { get; set; }
+        /// <summary>
+        /// 族名称
+        /// </summary>
+        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
+        public string FamilyName { get; set; }
+
+        /// <summary>
+        /// 构件类型
+        /// </summary>
+        public string Type { get; set; }
+        /// <summary>
+        /// 高度范围(单位英寸)
+        /// </summary>
+        public string HeightRange { get; set; }
+    }
+}

+ 69 - 0
Executer/DataCheck/DataCheck.Mode/EquipInSpaceCheck.cs

@@ -0,0 +1,69 @@
+/* ==============================================================================
+ * 功能描述:SagaCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:09:09
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using Autodesk.Revit.DB.Mechanical;
+using SAGA.DotNetUtils.Extend;
+using ServiceRevitLib.Common;
+using SAGA.RevitUtils.Extends;
+using ServiceRevitLib.Extend;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheck
+    /// </summary>
+    class EquipInSpaceCheck : CheckBase
+    {
+        public override void Check()
+        {
+            base.Check();
+
+            #region
+
+            var document = m_Doc;
+            var elements = document.GetEqEcElements();
+            var rspaces = document.GetSpaces().Where(t => t.IsValidObject).ToList();
+            foreach (Element fi in elements)
+            {
+                var result = GetCheckResult(fi, rspaces);
+                Content.Add(result);
+            }
+
+            #endregion
+
+        }
+
+        /// <summary>
+        /// 获取检测结果
+        /// </summary>
+        /// <param name="fi"></param>
+        /// <returns></returns>
+        private EquipInSpaceCheckResult GetCheckResult(Element fi, List<Space> spaces)
+        {
+            var result = new EquipInSpaceCheckResult();
+            result.FamilyName = fi.GetFamilyName();
+            result.Id = fi.Id.ToString();
+            var space = fi.GetReferenceSpace(spaces);
+            if (space != null)
+            {
+                result.SpaceId = space.Id.ToString();
+                result.Result = ResultState.Success;
+            }
+            else
+            {
+                result.Result = ResultState.Failure;
+                result.ResultMsg = "请检查设备是否在空间中";
+            }
+
+            return result;
+        }
+    }
+}

+ 31 - 0
Executer/DataCheck/DataCheck.Mode/EquipInSpaceCheckResult.cs

@@ -0,0 +1,31 @@
+/* ==============================================================================
+ * 功能描述:SagaCheckResult  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:20:46
+ * ==============================================================================*/
+
+using Newtonsoft.Json;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheckResult
+    /// </summary>
+    class EquipInSpaceCheckResult : ResultBase
+    {
+        /// <summary>
+        /// id
+        /// </summary>
+        public string Id { get; set; }
+        /// <summary>
+        /// 族名称
+        /// </summary>
+        public string FamilyName { get; set; }
+        /// <summary>
+        /// 所在空间id
+        /// </summary>
+        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
+        public string SpaceId { get; set; }
+
+    }
+}

+ 55 - 0
Executer/DataCheck/DataCheck.Mode/EquipPartLocationCheck.cs

@@ -0,0 +1,55 @@
+/* ==============================================================================
+ * 功能描述:SagaCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:09:09
+ * ==============================================================================*/
+
+using System;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using SAGA.DotNetUtils.Extend;
+using ServiceRevitLib.Common;
+using SAGA.RevitUtils.Extends;
+using ServiceRevitLib.Extend;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheck
+    /// </summary>
+    class EquipPartLocationCheck : CheckBase
+    {
+        public override void Check()
+        {
+            base.Check();
+
+            #region
+            
+            var document = m_Doc;
+            var elements = document.GetEqEcElements();
+            var parts = elements.Where(t => t.IsEquipmentPart());
+            foreach (Element fi in parts)
+            {
+                var result = new EquipPartLocationCheckResult();
+                result.PartFamilyName = fi.GetFamilyName();
+                result.PartId = fi.Id.ToString();
+                var partParent = fi.GetPartParent();
+                if (partParent == null)
+                {
+                    result.Result = ResultState.Failure;
+                    result.ResultMsg = "未与设备相交,请检查";
+                }
+                else
+                {
+                    result.RefId = partParent.Id.ToString();
+                    result.Result = ResultState.Success;
+                }
+                Content.Add(result);
+            }
+
+            #endregion
+
+        }
+    }
+}

+ 27 - 0
Executer/DataCheck/DataCheck.Mode/EquipPartLocationCheckResult.cs

@@ -0,0 +1,27 @@
+/* ==============================================================================
+ * 功能描述:SagaCheckResult  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:20:46
+ * ==============================================================================*/
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheckResult
+    /// </summary>
+    class EquipPartLocationCheckResult : ResultBase
+    {
+        /// <summary>
+        /// 部件id
+        /// </summary>
+        public string PartId { get; set; }
+        /// <summary>
+        /// 部件族名称
+        /// </summary>
+        public string PartFamilyName { get; set; }
+        /// <summary>
+        /// 关联设备id
+        /// </summary>
+        public string RefId { get; set; }
+    }
+}

+ 78 - 0
Executer/DataCheck/DataCheck.Mode/FamilyNameCheck.cs

@@ -0,0 +1,78 @@
+/* ==============================================================================
+ * 功能描述:SagaCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:09:09
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using SAGA.DotNetUtils.Extend;
+using ServiceRevitLib.Common;
+using SAGA.RevitUtils.Extends;
+using ServiceRevitLib.Extend;
+using ServiceRevitLib.Utils;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheck
+    /// </summary>
+    class FamilyNameCheck : CheckBase
+    {
+        public FamilyNameCheck()
+        {
+            ReferenceSheet = "参考-revit分类";
+        }
+        public override void Check()
+        {
+            base.Check();
+
+            #region
+            
+            var ccategories = DataCheckRule.GetCodeCheckCategories();
+            var categories = m_Doc.Settings.Categories;
+            foreach (DCR_CodeCheckCategory ccategory in ccategories)
+            {
+                try
+                {
+                    var category = categories.get_Item(ccategory.Name);
+                    if (category == null) continue;
+                    BuiltInCategory builtInCategory = (BuiltInCategory)category.Id.IntegerValue;
+                    var elements = m_Doc.GetElements<FamilyInstance>(builtInCategory);
+                    var groupByFamily = elements.GroupBy(t => t.GetFamilyName());
+                    foreach (IGrouping<string, FamilyInstance> grouping in groupByFamily)
+                    {
+                        var subElements = grouping.ToList();
+                        var subElement = subElements.FirstOrDefault();
+                        if (subElement is FamilyInstance fi)
+                        {
+                            var result = new FamilyNameCheckResult();
+                            result.FamilyName = grouping.Key;
+                            if (fi.IsEquipment()|| fi.IsEquipmentPart()|| fi.IsBeacon())
+                            {
+                                result.Result = ResultState.Success;
+                            }
+                            else
+                            {
+                                result.Result = ResultState.Failure;
+                                result.ResultMsg = "请检查族名称编码是否符合要求";
+                            }
+                            Content.Add(result);
+                        }
+                    }
+                }
+                catch (Exception e)
+                {
+                    Console.WriteLine(e);
+                }
+            }
+
+            #endregion
+
+        }
+        
+    }
+}

+ 19 - 0
Executer/DataCheck/DataCheck.Mode/FamilyNameCheckResult.cs

@@ -0,0 +1,19 @@
+/* ==============================================================================
+ * 功能描述:SagaCheckResult  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:20:46
+ * ==============================================================================*/
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheckResult
+    /// </summary>
+    class FamilyNameCheckResult : ResultBase
+    {
+        /// <summary>
+        /// 族名称
+        /// </summary>
+        public string FamilyName { get; set; }
+    }
+}

+ 78 - 0
Executer/DataCheck/DataCheck.Mode/ParameterIntegrityCheck.cs

@@ -0,0 +1,78 @@
+/* ==============================================================================
+ * 功能描述:SagaCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:09:09
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using SAGA.DotNetUtils.Extend;
+using ServiceRevitLib.Common;
+using SAGA.RevitUtils.Extends;
+using ServiceRevitLib.Extend;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheck
+    /// </summary>
+    class ParameterIntegrityCheck : CheckBase
+    {
+        public override void Check()
+        {
+            base.Check();
+
+            #region
+
+            var doc = m_Doc;
+            var instances = doc.GetEqEcElements();
+            var familyGroups = instances.GroupBy(t => t.GetFamilyName());
+            foreach (IGrouping<string, Element> familyGroup in familyGroups)
+            {
+                Element fi = familyGroup.FirstOrDefault();
+                if (fi == null) continue;
+                var result = GetCheckResult(fi);
+                if (result == null) continue;
+                result.FamilyName = familyGroup.Key;
+                Content.Add(result);
+            }
+
+            #endregion
+
+        }
+
+
+        /// <summary>
+        /// 获取检测结果
+        /// </summary>
+        /// <param name="fi"></param>
+        /// <returns></returns>
+        private ParameterIntegrityCheckResult GetCheckResult(Element fi)
+        {
+            //检查项
+            var checkParamNames = new List<string>() { MBIConst.EquipLocalName, MBIConst.EquipLocalID };
+
+            var result = new ParameterIntegrityCheckResult();
+            List<string> list = new List<string>();
+            foreach (var paramName in checkParamNames)
+            {
+                var parameter = fi.GetParameter(paramName);
+                if (parameter == null)
+                    list.Add(paramName);
+            }
+            if (list.Any())
+            {
+                result.Result = ResultState.Failure;
+                result.ResultMsg = $"缺失的参数为:{string.Join("、", list)}";
+            }
+            else
+            {
+                result.Result = ResultState.Success;
+            }
+            return result;
+        }
+    }
+}

+ 20 - 0
Executer/DataCheck/DataCheck.Mode/ParameterIntegrityCheckResult.cs

@@ -0,0 +1,20 @@
+/* ==============================================================================
+ * 功能描述:SagaCheckResult  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:20:46
+ * ==============================================================================*/
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheckResult
+    /// </summary>
+    class ParameterIntegrityCheckResult : ResultBase
+    {
+        /// <summary>
+        /// 族名称
+        /// </summary>
+        public string FamilyName { get; set; }
+        
+    }
+}

+ 35 - 0
Executer/DataCheck/DataCheck.Mode/ResultBase.cs

@@ -0,0 +1,35 @@
+/* ==============================================================================
+ * 功能描述:
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:24:04
+ * ==============================================================================*/
+
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// CheckResultBase
+    /// </summary>
+    public class ResultBase
+    {
+        public ResultBase()
+        {
+            Result = ResultState.Success;
+        }
+        /// <summary>
+        /// 成功或失败结果描述
+        /// </summary>
+        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
+        public string ResultMsg { get; set; }
+
+        /// <summary>
+        /// 结果
+        /// </summary>
+        [JsonConverter(typeof(StringEnumConverter))]
+        public ResultState Result { get; set; }
+
+
+    }
+}

+ 17 - 0
Executer/DataCheck/DataCheck.Mode/ResultState.cs

@@ -0,0 +1,17 @@
+/* ==============================================================================
+ * 功能描述:结果的状态
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:29:04
+ * ==============================================================================*/
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// ResultState
+    /// </summary>
+    public enum ResultState
+    {
+        Failure=0,
+        Success,
+    }
+}

+ 90 - 0
Executer/DataCheck/DataCheck.Mode/SagaCheck.cs

@@ -0,0 +1,90 @@
+/* ==============================================================================
+ * 功能描述:SagaCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:09:09
+ * ==============================================================================*/
+
+using System;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using SAGA.DotNetUtils.Extend;
+using ServiceRevitLib.Common;
+using SAGA.RevitUtils.Extends;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheck
+    /// </summary>
+    class SagaCheck : CheckBase
+    {
+        public override void Check()
+        {
+            base.Check();
+
+            #region
+
+            string resultMsg = null;
+            ResultState resultState = 0;
+            string planName = "";
+
+            //判断是否存在Saga标记
+            var document = m_Doc;
+            var sagaPlans = document.GetElements<ViewPlan>()
+                .Where(t => t.ViewType == ViewType.FloorPlan && t.Name.Contains("-saga")).ToList();
+            if (sagaPlans.Count == 0)
+            {
+                resultState = ResultState.Failure;
+                resultMsg = "缺少saga标记";
+            }
+            else if (sagaPlans.Count() >= 2)
+            {
+                resultState = ResultState.Failure;
+                resultMsg = "有多个saga标记";
+            }
+            else
+            {
+                //只有一个saga标记
+                var sagaPlan = sagaPlans.FirstOrDefault();
+                if (sagaPlan != null)
+                {
+                    planName = sagaPlan.Name;
+                    //打标记的楼层名称必需为指定格式;B1,B1M,F1,F1M,RFM,RF
+                    if (Regex.IsMatch(planName, $"{RegexConstPattern.IsMBIView}"))
+                    {
+                        var rfLevel = document.GetLevels().FirstOrDefault(t =>
+                            System.Text.RegularExpressions.Regex.IsMatch(t.Name, $"{RegexConstPattern.IsRF}"));
+                        if (rfLevel == null)
+                        {
+                            resultState = ResultState.Failure;
+                            resultMsg = $"缺少RF标高";
+                        }
+                        else
+                        {
+                            if (rfLevel.Elevation.IsThanEq(sagaPlan.GenLevel.Elevation))
+                            {
+                                resultState = ResultState.Success;
+                            }
+                            else
+                            {
+                                resultState = ResultState.Failure;
+                                resultMsg = $"RF标高的位置不正确,请检查";
+                            }
+                        }
+                    }
+                    else
+                    {
+                        resultState = ResultState.Failure;
+                        resultMsg = $"楼层 {planName} 不符合楼层命名规范";
+                    }
+                }
+            }
+
+            Content.Add(new SagaCheckResult() {PlanName = planName, Result = resultState, ResultMsg = resultMsg});
+
+            #endregion
+
+        }
+    }
+}

+ 19 - 0
Executer/DataCheck/DataCheck.Mode/SagaCheckResult.cs

@@ -0,0 +1,19 @@
+/* ==============================================================================
+ * 功能描述:SagaCheckResult  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:20:46
+ * ==============================================================================*/
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheckResult
+    /// </summary>
+    class SagaCheckResult: ResultBase
+    {
+        /// <summary>
+        /// Saga视图的名称
+        /// </summary>
+        public string PlanName { get; set; }
+    }
+}

+ 92 - 0
Executer/DataCheck/DataCheck.Mode/SystemNameCheck.cs

@@ -0,0 +1,92 @@
+/* ==============================================================================
+ * 功能描述:SagaCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:09:09
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using Autodesk.Revit.DB.Mechanical;
+using SAGA.DotNetUtils.Extend;
+using ServiceRevitLib.Common;
+using SAGA.RevitUtils.Extends;
+using SAGA.RevitUtils.MEP;
+using ServiceRevitLib.Extend;
+using ServiceRevitLib.Utils;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheck
+    /// </summary>
+    class SystemNameCheck : CheckBase
+    {
+        public SystemNameCheck()
+        {
+            ReferenceSheet = "参考-可识别的系统名称";
+        }
+        public override void Check()
+        {
+            base.Check();
+
+            #region
+
+            m_MEPSystems = DataCheckRule.GetMepSystems();
+
+            var mepsystemTypes = new List<MEPSystemType>();
+            mepsystemTypes.AddRange(m_Doc.GetMechanicalSystemTypes());
+            mepsystemTypes.AddRange(m_Doc.GetPipingSystemTypes());
+            foreach (var t in mepsystemTypes)
+            {
+                var result = GetCheckResult(t);
+                Content.Add(result);
+            }
+
+            #endregion
+
+        }
+        private List<DCR_MEPSystem> m_MEPSystems;
+
+        /// <summary>
+        /// 获取检测结果
+        /// </summary>
+        /// <param name="fi"></param>
+        /// <returns></returns>
+        private SystemNameCheckResult GetCheckResult(MEPSystemType system)
+        {
+            var result = new SystemNameCheckResult();
+            string systemName = system.Name;
+            result.SystemName = systemName;
+            result.SystemType = system is MechanicalSystemType ? "风管系统" : "管道系统";
+            
+            var item = m_MEPSystems.Where(t => SystemNameIsEqual(systemName, t.Name));
+            if (item.Any())
+            {
+                result.Result = ResultState.Success;
+            }
+            else
+            {
+                result.Result = ResultState.Failure;
+                result.ResultMsg = $"未知的系统名称,请按照系统类型命名规范修改";
+            }
+            
+            return result;
+        }
+        /// <summary>
+        /// 系统名称相等,模型中的系统名称包含就定义名称即可
+        /// </summary>
+        /// <param name="originName"></param>
+        /// <param name="targetName"></param>
+        /// <returns></returns>
+        private bool SystemNameIsEqual(string originName, string targetName)
+        {
+            bool result = false;
+            string n1 = originName.ToLower();
+            string n2 = targetName.ToLower();
+            return n1.Equals(n2);
+        }
+    }
+}

+ 24 - 0
Executer/DataCheck/DataCheck.Mode/SystemNameCheckResult.cs

@@ -0,0 +1,24 @@
+/* ==============================================================================
+ * 功能描述:SagaCheckResult  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:20:46
+ * ==============================================================================*/
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheckResult
+    /// </summary>
+    class SystemNameCheckResult : ResultBase
+    {
+        /// <summary>
+        /// 系统名称
+        /// </summary>
+        public string SystemName { get; set; }
+        /// <summary>
+        /// 系统类型
+        /// </summary>
+        public string SystemType { get; set; }
+        
+    }
+}

+ 125 - 0
Executer/DataCheck/DataCheck.Mode/SystemReferEquipCheck.cs

@@ -0,0 +1,125 @@
+/* ==============================================================================
+ * 功能描述:SagaCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:09:09
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using SAGA.DotNetUtils.Extend;
+using SAGA.DotNetUtils.Logger;
+using ServiceRevitLib.Common;
+using SAGA.RevitUtils.Extends;
+using SAGA.RevitUtils.MEP;
+using ServiceRevitLib.Extend;
+using ServiceRevitLib.Utils;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheck
+    /// </summary>
+    class SystemReferEquipCheck : CheckBase
+    {
+        public SystemReferEquipCheck()
+        {
+            ReferenceSheet = "参考-管网及相关设备";
+        }
+        public override void Check()
+        {
+            base.Check();
+
+            #region
+
+            m_EquipReferSystems = DataCheckRule.GetEquipReferSystems();
+
+            var elements = m_Doc.GetEqEcElements();
+            foreach (Element element in elements)
+            {
+                var result = GetCheckResult(element);
+                if (result == null) continue;
+                Content.Add(result);
+            }
+
+            #endregion
+
+        }
+
+        private List<DCR_EquipReferSystem> m_EquipReferSystems;
+     
+
+        /// <summary>
+        /// 获取检测结果
+        /// </summary>
+        /// <param name="fi"></param>
+        /// <returns></returns>
+        private SystemReferEquipCheckResult GetCheckResult(Element element)
+        {
+            var result = new SystemReferEquipCheckResult();
+            var code = element.GetFamilyCode();
+            // 可以与设备连接的系统
+            var referSystems = m_EquipReferSystems.FirstOrDefault(t => t.EquipName == code)?.Systems ?? new List<string>();
+            if (referSystems.Count == 0) return null;
+
+            result.FamilyName = element.GetFamilyName();
+            result.Id = element.Id.ToString();
+
+            var tuple = CheckConType(element, referSystems);
+            if (tuple.Item2.Any())
+            {
+                result.ResultMsg = $"连接件所连接的管道系统与规范不一致,请检查";
+                result.UnPassSystems += string.Join("、", tuple.Item2.ToArray());
+                result.Result = ResultState.Failure;
+            }
+            else
+            {
+                result.Result = ResultState.Success;
+            }
+            result.PassSystems += string.Join("、", tuple.Item1.ToArray());
+
+            return result;
+        }
+
+        /// <summary>
+        /// 检查连接件连接的管道系统是否符合规范
+        /// </summary>
+        /// <param name="result">符合要求的系统名称</param>
+        /// <param name="domain">不符合要求的系统名称</param>
+        private Tuple<List<string>, List<string>> CheckConType(Element element, List<string> referSystems)
+        {
+            List<string> passList = new List<string>();
+            List<string> unpassList = new List<string>();
+
+            var connectors = element.GetAllConnectors();
+            foreach (Connector connector in connectors)
+            {
+                try
+                {
+                    var mepSystem = connector.MEPSystem;
+                    if (mepSystem == null) continue;
+                    var elementId = mepSystem.GetTypeId();
+                    var type = element.Document.GetElement(elementId);
+                    if (!referSystems.Contains(type.Name))
+                    {
+                        unpassList.Add(type.Name);
+                    }
+                    else
+                    {
+                        passList.Add(type.Name);
+                    }
+                }
+                catch (Exception e)
+                {
+                    Log4Net.Info($"读取连接件系统错误。Id:{element.Id},Path:{element.Document.PathName}");
+                }
+            }
+
+            return new Tuple<List<string>, List<string>>(passList, unpassList);
+        }
+
+
+    }
+}

+ 37 - 0
Executer/DataCheck/DataCheck.Mode/SystemReferEquipCheckResult.cs

@@ -0,0 +1,37 @@
+/* ==============================================================================
+ * 功能描述:SagaCheckResult  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:20:46
+ * ==============================================================================*/
+
+using Newtonsoft.Json;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheckResult
+    /// </summary>
+    class SystemReferEquipCheckResult : ResultBase
+    {
+        /// <summary>
+        /// id
+        /// </summary>
+        public string Id { get; set; }
+        /// <summary>
+        /// 族名称
+        /// </summary>
+        public string FamilyName { get; set; }
+
+        /// <summary>
+        /// 合法的系统名称集合
+        /// </summary>
+        public string PassSystems { get; set; }
+        /// <summary>
+        /// 不合法的系统名称集合
+        /// </summary>
+        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
+        public string UnPassSystems { get; set; }
+
+
+    }
+}

+ 45 - 0
Executer/DataCheck/DataCheck.Mode/UnitCheck.cs

@@ -0,0 +1,45 @@
+/* ==============================================================================
+ * 功能描述:SagaCheck  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/11 16:09:09
+ * ==============================================================================*/
+
+using System;
+using Autodesk.Revit.DB;
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheck
+    /// </summary>
+    class UnitCheck : CheckBase
+    {
+        public override void Check()
+        {
+            base.Check();
+
+            #region
+
+            string resultMsg =null;
+            ResultState resultState = ResultState.Failure;
+            string unit = "";
+            
+            var formatOptions = m_Doc.GetUnits().GetFormatOptions(UnitType.UT_Length);
+            var ismmUnit= formatOptions.DisplayUnits == DisplayUnitType.DUT_MILLIMETERS;
+            unit = formatOptions.DisplayUnits.ToString();
+            if (!ismmUnit)
+            {
+                resultMsg = "单位异常,请修改长度单位为毫米(mm)";
+                resultState = ResultState.Failure;
+            }
+            else
+            {
+                resultState = ResultState.Success;
+            }
+
+            Content.Add(new UnitCheckResult() { Unit = unit, Result = resultState, ResultMsg = resultMsg });
+
+            #endregion
+        }
+    }
+}

+ 19 - 0
Executer/DataCheck/DataCheck.Mode/UnitCheckResult.cs

@@ -0,0 +1,19 @@
+/* ==============================================================================
+ * 功能描述:SagaCheckResult  
+ * 创 建 者:Garrett
+ * 创建日期:2019/5/31 16:20:46
+ * ==============================================================================*/
+
+namespace ServiceRevitLib.Mode
+{
+    /// <summary>
+    /// SagaCheckResult
+    /// </summary>
+    class UnitCheckResult : ResultBase
+    {
+        /// <summary>
+        /// 项目单位
+        /// </summary>
+        public string Unit { get; set; }
+    }
+}

BIN
Executer/DataCheck/DataCheckResource/垃圾数据检查结果输出-模版.xlsx


BIN
Executer/DataCheck/DataCheckResource/模型检查结果输出格式-模版.xlsx


BIN
Executer/DataCheck/Dlls/RevitAPI.dll


BIN
Executer/DataCheck/Dlls/RevitAPIUI.dll


BIN
Executer/DataCheck/Dlls/RevitAddInUtility.dll


BIN
Executer/DataCheck/Dlls/RevitNET.dll


BIN
Executer/DataCheck/Dlls/SAGA.DotNetUtils.dll


BIN
Executer/DataCheck/Dlls/SAGA.RevitUtils.dll


+ 38 - 0
Executer/DataCheck/Extend/DocExtend.cs

@@ -0,0 +1,38 @@
+/* ==============================================================================
+ * 功能描述:DocExtend  
+ * 创 建 者:Garrett
+ * 创建日期:2018/6/11 16:00:53
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using SAGA.DotNetUtils;
+using SAGA.RevitUtils.Extends;
+using ServiceRevitLib.Common;
+
+namespace ServiceRevitLib.Extend
+{
+    /// <summary>
+    /// DocExtend
+    /// </summary>
+    public static class DocExtend
+    {
+        /// <summary>
+        /// 获取所有的Docment中,设备或者部件
+        /// </summary>
+        /// <param name="doc"></param>
+        /// <param name="bic"></param>
+        /// <returns></returns>
+        public static List<Element> GetEqEcElements(this Document doc)
+        {
+            List<Element> elements = new List<Element>();
+            //elements.AddRange(doc.GetElements(typeof(Wall)));
+            elements.AddRange(doc.GetElements(typeof(FamilyInstance)));
+            return elements.Where(t=>t.IsMbiEquipment()).ToList();
+        }
+    }
+}

+ 239 - 0
Executer/DataCheck/Extend/ElementExtend.cs

@@ -0,0 +1,239 @@
+/* ==============================================================================
+ * 功能描述:ElementExtend  
+ * 创 建 者:Garrett
+ * 创建日期:2018/5/28 16:41:22
+ * ==============================================================================*/
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using Autodesk.Revit.DB;
+using Autodesk.Revit.DB.Mechanical;
+using SAGA.DotNetUtils;
+using SAGA.DotNetUtils.Extend;
+using SAGA.RevitUtils.Extends;
+using ServiceRevitLib.Common;
+
+namespace ServiceRevitLib.Extend
+{
+    /// <summary>
+    /// ElementExtend
+    /// </summary>
+    public static class ElementExtend
+    {
+        /// <summary>
+        /// 判断是否为设备 设备族为4位
+        /// ATVR - 多联机 - 室内机 - 双向气流 - 天花板嵌入式
+        /// </summary>
+        /// <param name="fi"></param>
+        /// <returns></returns>
+        public static bool IsEquipment(this Element element)
+        {
+            bool result = false;
+            //if (element is Wall wall)
+            //{//添加幕墙识别
+            //    result = wall.WallType.Kind == WallKind.Curtain;
+
+            //}
+            //else
+            if (element is FamilyInstance fi)
+            {
+                var family = fi.GetFamilyName();
+                result = Regex.IsMatch(family, $"{RegexConstPattern.IsEquip}");
+            }
+
+            return result;
+        }
+        /// <summary>
+        /// 判断是否为设备部件 设备族为6位
+        /// </summary>
+        /// <param name="fi"></param>
+        /// <returns></returns>
+        public static bool IsEquipmentPart(this Element element)
+        {
+            bool result = false;
+            if (element is FamilyInstance fi)
+            {
+                var family = fi.GetFamilyName();
+                result = Regex.IsMatch(family, $"{RegexConstPattern.IsEquipPart}");
+            }
+
+            return result;
+        }
+        /// <summary>
+        /// 广义mbi设备包含设备和部件
+        /// </summary>
+        /// <param name="family"></param>
+        /// <returns></returns>
+        public static bool IsMbiEquipment(this Element element)
+        {
+            return element.IsEquipment()||element.IsEquipmentPart();
+        }
+        /// <summary>
+        /// 判断是否为信标
+        /// </summary>
+        /// <param name="elem"></param>
+        /// <returns></returns>
+        public static bool IsBeacon(this Element elem)
+        {
+            var family = elem.GetFamilyName();
+            return family != null && (Regex.IsMatch(family, RegexConstPattern.IsBeacon));
+        }
+
+        /// <summary>
+        /// 判断是否为空间,判断周长是否为零
+        /// 如果周长为零,是删除的空间
+        /// </summary>
+        /// <param name="elem"></param>
+        /// <param name="ischeckzero">是否检查周长为零</param>
+        /// <returns></returns>
+        public static bool IsSpace(this Element elem, bool ischeckzero = true)
+        {
+            var isspace = false;
+            if (elem is Space space)
+            {
+                //空间比较特殊,周长为零就相当于删除
+                isspace = !ischeckzero || !(space.IsDeleteSpace());
+                //限制所用空间的阶段
+                //isspace = isspace && space.IsPhase1Space();
+            }
+
+            return isspace;
+        }
+        /// <summary>
+        /// 获取MBI的定位点
+        /// </summary>
+        /// <param name="element"></param>
+        /// <returns></returns>
+        public static XYZ GetLocationPointMBIXYZ(this Element element)
+        {
+            ////定位点不可靠,未来可能会更改为Box的中心点
+            //XYZ bimXyz = element.GetLocationPoint();
+            //if (element is FamilyInstance fi)
+            //{
+            //    var family = fi.GetFamily();
+            //    if (family.IsInPlace)
+            //    {
+            //        bimXyz = fi.GetBoxCenter();
+            //    }
+            //}
+            //定位点改为Box中心点 
+            XYZ bimXyz = element.GetBoxCenter();
+
+            return bimXyz;
+        }
+        /// <summary>
+        /// 获取MBI存储的位置信息
+        /// </summary>
+        /// <returns></returns>
+        public static string GetLocationPointMBI(this Element element)
+        {
+            string str = ",,";
+            XYZ bimXyz = element.GetLocationPointMBIXYZ();
+            if (bimXyz != null)
+            {
+                str = bimXyz.FromApi().ToString(null);
+            };
+            //JObject jObject = new JObject();
+            //jObject.Add("X", bimXyz.X);
+            //jObject.Add("Y", bimXyz.Y);
+            //jObject.Add("Z", bimXyz.Z);
+            //return (new JArray(jObject)).ToString();
+            return str;
+        }
+        /// <summary>
+        /// 获取MBI存储的位置信息
+        /// </summary>
+        /// <returns></returns>
+        public static XYZ ToXyz(this string xyzstr)
+        {
+            XYZ xyz = null;
+            var strs = xyzstr.Split(',');
+            if (strs.Length == 3)
+            {
+                xyz = new XYZ(strs[0].ToDouble(), strs[1].ToDouble(), strs[2].ToDouble());
+            }
+            //JObject jObject = new JObject();
+            //jObject.Add("X", bimXyz.X);
+            //jObject.Add("Y", bimXyz.Y);
+            //jObject.Add("Z", bimXyz.Z);
+            //return (new JArray(jObject)).ToString();
+            return xyz;
+        }
+
+        /// <summary>
+        /// 获取设备的种族类型编码 ATFC
+        /// 族名称的命名规则:ATFC-风机盘管
+        /// </summary>
+        /// <returns></returns>
+        public static string GetFamilyCode(this Element element)
+        {          
+            string code = "";
+            if (element is FamilyInstance fi)
+            {
+                string familyName = fi.GetFamilyName();
+                if (familyName == null) return code;
+                //族名称的命名规则:ATFC-风机盘管
+                int index = familyName.IndexOf('-');
+                if (index != -1 && index + 1 != familyName.Length)
+                    code = familyName.Substring(0, familyName.IndexOf('-'));
+                //移除前面和后面的空格
+                code = code.Trim();
+            }
+
+            return code;
+        }
+
+        public static string GetFamilyName(this Element element)
+        {
+            return element.GetFamily()?.Name;
+        }
+        /// <summary>
+        /// 获取关联的空间
+        /// </summary>
+        /// <param name="fi"></param>
+        /// <returns></returns>
+        public static Space GetReferenceSpace(this Element element, List<Space> spaces = null)
+        {
+            Space space = null;
+            if (element is FamilyInstance fi)
+            {
+                space = fi.Space;
+                if (space != null) return space;
+                if (spaces == null)
+                    spaces = fi.Document.GetSpaces().Where(t => t.IsValidObject).ToList();
+                var origin1 = fi.GetLocationPointMBIXYZ();
+                foreach (Space tempSpace in spaces)
+                {
+                    //没有Space属性,取定位点,判断定位点所在空间
+                    if (tempSpace.IsPointInSpace(origin1))
+                    {
+                        space = tempSpace;
+                        break;
+                    }
+                }
+            }else if (element is Wall wall)
+            {
+                if (wall.IsCurtaiWall())
+                    space = null;
+            }
+
+            return space;
+        }
+
+        /// <summary>
+        /// 获取部件所关联的设备
+        /// </summary>
+        /// <param name="fi"></param>
+        /// <returns></returns>
+        public static Element GetPartParent(this Element element)
+        {
+            string code = element?.GetFamily().Name.Substring(0, 4); ;
+            if (code.IsNullOrEmpty()) return null;
+            //构件所关联的设备
+            var parentInst = element?.Document.GetElements(new ElementIntersectsElementFilter(element))
+                .FirstOrDefault(t => !t.Id.IsEqual(element.Id) && t.GetFamilyCode() == code);
+            return parentInst;
+        }
+    }
+}

+ 36 - 0
Executer/DataCheck/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("ServiceRevitLib")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ServiceRevitLib")]
+[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("7b748b09-dc20-4406-85a3-101e7833f8ce")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 123 - 0
Executer/DataCheck/ServiceDataCheck.csproj

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{7B748B09-DC20-4406-85A3-101E7833F8CE}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <RootNamespace>ServiceRevitLib</RootNamespace>
+    <AssemblyName>ServiceRevitLib</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\OutputDll\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\OutputDll\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <StartupObject />
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ICSharpCode.SharpZipLib, Version=1.0.0.999, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\SharpZipLib.1.0.0\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
+    </Reference>
+    <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI, Version=2.3.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\NPOI.2.3.0\lib\net40\NPOI.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OOXML, Version=2.3.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\NPOI.2.3.0\lib\net40\NPOI.OOXML.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OpenXml4Net, Version=2.3.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\NPOI.2.3.0\lib\net40\NPOI.OpenXml4Net.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OpenXmlFormats, Version=2.3.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\NPOI.2.3.0\lib\net40\NPOI.OpenXmlFormats.dll</HintPath>
+    </Reference>
+    <Reference Include="RevitAPI">
+      <HintPath>Dlls\RevitAPI.dll</HintPath>
+    </Reference>
+    <Reference Include="SAGA.DotNetUtils">
+      <HintPath>Dlls\SAGA.DotNetUtils.dll</HintPath>
+    </Reference>
+    <Reference Include="SAGA.RevitUtils">
+      <HintPath>Dlls\SAGA.RevitUtils.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+    <Reference Include="UIFramework">
+      <HintPath>E:\Program Files\Autodesk\Revit 2017\UIFramework.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="CheckFactory.cs" />
+    <Compile Include="Common\MBIConst.cs" />
+    <Compile Include="Common\RegexConstPattern.cs" />
+    <Compile Include="Extend\DocExtend.cs" />
+    <Compile Include="Extend\ElementExtend.cs" />
+    <Compile Include="DataCheck.Mode\CheckBase.cs" />
+    <Compile Include="DataCheck.Mode\EquipInSpaceCheck.cs" />
+    <Compile Include="DataCheck.Mode\SystemReferEquipCheck.cs" />
+    <Compile Include="DataCheck.Mode\ParameterIntegrityCheck.cs" />
+    <Compile Include="DataCheck.Mode\SystemNameCheck.cs" />
+    <Compile Include="DataCheck.Mode\EquipInSpaceCheckResult.cs" />
+    <Compile Include="DataCheck.Mode\SystemReferEquipCheckResult.cs" />
+    <Compile Include="DataCheck.Mode\ParameterIntegrityCheckResult.cs" />
+    <Compile Include="DataCheck.Mode\SystemNameCheckResult.cs" />
+    <Compile Include="DataCheck.Mode\ResultBase.cs" />
+    <Compile Include="DataCheck.Mode\ResultState.cs" />
+    <Compile Include="DataCheck.Mode\EquipPartLocationCheck.cs" />
+    <Compile Include="DataCheck.Mode\ColumnCheck.cs" />
+    <Compile Include="DataCheck.Mode\ElementRangeCheck.cs" />
+    <Compile Include="DataCheck.Mode\ConnectorCheck.cs" />
+    <Compile Include="DataCheck.Mode\FamilyNameCheck.cs" />
+    <Compile Include="DataCheck.Mode\EquipPartLocationCheckResult.cs" />
+    <Compile Include="DataCheck.Mode\ColumnCheckResult.cs" />
+    <Compile Include="DataCheck.Mode\ElementRangeCheckResult.cs" />
+    <Compile Include="DataCheck.Mode\ConnectorCheckResult.cs" />
+    <Compile Include="DataCheck.Mode\FamilyNameCheckResult.cs" />
+    <Compile Include="DataCheck.Mode\UnitCheck.cs" />
+    <Compile Include="DataCheck.Mode\SagaCheck.cs" />
+    <Compile Include="DataCheck.Mode\UnitCheckResult.cs" />
+    <Compile Include="DataCheck.Mode\SagaCheckResult.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="TestCommand.cs" />
+    <Compile Include="Utils\DataCheckRule.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="DataCheckResource\垃圾数据检查结果输出-模版.xlsx">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="DataCheckResource\模型检查结果输出格式-模版.xlsx">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <None Include="app.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 6 - 0
Executer/DataCheck/ServiceDataCheck.csproj.user

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectView>ShowAllFiles</ProjectView>
+  </PropertyGroup>
+</Project>

+ 42 - 0
Executer/DataCheck/TestCommand.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using Autodesk.Revit.Attributes;
+using Autodesk.Revit.DB;
+using Autodesk.Revit.UI;
+using Newtonsoft.Json;
+using SAGA.DotNetUtils.Data;
+using SAGA.DotNetUtils.Geometry;
+using SAGA.RevitUtils;
+using SAGA.RevitUtils.Extends;
+
+namespace ServiceRevitLib
+{
+    #region 测试命令
+
+    public class ServiceDataCheckTest
+    {
+        public static void Check(Document doc)
+        {
+            try
+            {
+                var factory = new CheckFactory();
+                factory.SetCheckItems("SagaCheck,UnitCheck,FamilyNameCheck,EquipPartLocationCheck,ColumnCheck,ElementRangeCheck,ConnectorCheck,SystemNameCheck,EquipInSpaceCheck,SystemReferEquipCheck,ParameterIntegrityCheck");
+                factory.Check(doc);
+                var result = JsonConvert.SerializeObject(factory);
+                string fileName = DateTime.Now.ToString("yyyyMMddHHmmss");
+                string path = Path.Combine(@"D:\", $"DataCheck{fileName}.json");
+                File.WriteAllText(path, result);
+                System.Diagnostics.Process.Start("notepad.exe", path);
+            }
+            catch (Exception e)
+            {
+            }
+        }
+    }
+   
+
+    #endregion
+}

+ 166 - 0
Executer/DataCheck/Utils/DataCheckRule.cs

@@ -0,0 +1,166 @@
+/* ==============================================================================
+ * 功能描述:数据检查规范
+ * 创 建 者:Garrett
+ * 创建日期:2018/11/7 15:40:23
+ * ==============================================================================*/
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text.RegularExpressions;
+using SAGA.DotNetUtils;
+using SAGA.DotNetUtils.NPOI;
+using ServiceRevitLib.Common;
+
+namespace ServiceRevitLib.Utils
+{
+    /// <summary>
+    /// DataCheckRule
+    /// </summary>
+    class DataCheckRule
+    {
+        public static string MCRPath = Path.Combine(MBIConst.MBIResourcePath, @"DataCheck\模型检查结果输出格式-模版.xlsx");
+        /// <summary>
+        /// 获取设备编码检查Cateogry 列表
+        /// </summary>
+        /// <returns></returns>
+        public static List<DCR_CodeCheckCategory> GetCodeCheckCategories()
+        {
+            var list = NPOIHelper
+                .ConvertExcelSheetToModel<DCR_CodeCheckCategory>(MCRPath);
+            return list;
+        }
+
+        /// <summary>
+        /// 获取预定义的连接件类
+        /// </summary>
+        /// <returns></returns>
+        public static List<DCR_Connector> GetPreDefineConnectors()
+        {
+            var list = NPOIHelper
+                .ConvertExcelSheetToModel<DCR_Connector>(MCRPath);
+            return list;
+        }
+
+        /// <summary>
+        /// 获取可识别的管道系统名称
+        /// </summary>
+        /// <returns></returns>
+        public static List<DCR_MEPSystem> GetMepSystems()
+        {
+            var list = NPOIHelper
+                .ConvertExcelSheetToModel<DCR_MEPSystem>(MCRPath);
+            return list;
+        }
+        /// <summary>
+        /// 获取设备关联的系统类型
+        /// </summary>
+        /// <returns></returns>
+        public static List<DCR_EquipReferSystem> GetEquipReferSystems()
+        {
+            var list = NPOIHelper
+                .ConvertExcelSheetToModel<DCR_SystemReferEquip>(MCRPath);
+            List<Tuple<string, string>> tuples = new List<Tuple<string, string>>();
+            //将集合转化为:系统名称-设备名称
+            list.ForEach(t => t.Equips.ForEach(tt => tuples.Add(new Tuple<string, string>(t.SystemName, tt))));
+            //将集合转化为:设备名称-多个系统名称
+            var newList = tuples.GroupBy(t => t.Item2).Select(tt => new DCR_EquipReferSystem()
+            { EquipName = tt.Key, Systems = tt.Select(t => t.Item1).ToList() }).ToList();
+            return newList;
+        }
+    }
+    /// <summary>
+    /// 参考-可识别的系统名称
+    /// </summary>
+    [SheetInfo(SheetName = "参考-可识别的系统名称", RowStartIndex = 0)]
+    public class DCR_MEPSystem
+    {
+        [CellIndex(0)]
+        public string Name { get; set; }
+    }
+    /// <summary>
+    /// 参考-revit分类
+    /// </summary>
+    [SheetInfo(SheetName = "参考-revit分类", RowStartIndex = 0)]
+    public class DCR_CodeCheckCategory
+    {
+        [CellIndex(0)]
+        public string Name { get; set; }
+    }
+    /// <summary>
+    /// 设备类是否有连接件
+    /// </summary>
+    [SheetInfo(SheetName = "参考-连接件对照表", RowStartIndex = 1)]
+    public class DCR_Connector
+    {
+        [CellIndex(4)]
+        public string Name { get; set; }
+
+        [CellIndex(5)]
+        public string Code { get; set; }
+
+        [CellIndex(6)]
+        public string PName { get; set; }
+
+        [CellIndex(7)]
+        public string PCode { get; set; }
+
+        [CellIndex(8)]
+        public string HvacConnector { get; set; }
+
+        [CellIndex(9)]
+        public string PipeConnector { get; set; }
+    }
+    /// <summary>
+    /// 参考-管网与相关设备
+    /// </summary>
+    [SheetInfo(SheetName = "参考-管网及相关设备", RowStartIndex = 3)]
+    public class DCR_SystemReferEquip
+    {
+        [CellIndex(3)]
+        public string SystemName { get; set; }
+        [CellIndex(4)]
+        public string ReferEquipName { get; set; }
+
+        private List<string> m_Equips;
+
+        public List<string> Equips
+        {
+            get
+            {
+                if (m_Equips == null)
+                    m_Equips = ConverToList(ReferEquipName);
+                return m_Equips;
+            }
+        }
+
+        public List<string> ConverToList(string str)
+        {
+            var list = new List<string>();
+            if (str.IsNotNullEmpty())
+            {
+                Regex regex = new Regex(@"^[A-Z]{4}");
+                list = str.Split(new[] { ',', ',' })
+                    .Where(t => Regex.IsMatch(t, $"{RegexConstPattern.IsEquip}"))
+                    .Select(tt => regex.Match(tt).Value).ToList();
+            }
+
+            return list;
+        }
+    }
+    /// <summary>
+    /// 设备关联的系统
+    /// </summary>
+    public class DCR_EquipReferSystem
+    {
+        /// <summary>
+        /// 设备名称
+        /// </summary>
+        public string EquipName { get; set; }
+        /// <summary>
+        /// 系统名称
+        /// </summary>
+        public List<string> Systems { get; set; }
+    }
+}

+ 19 - 0
Executer/DataCheck/app.config

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="NPOI" publicKeyToken="0df73ec7942b34e1" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="NPOI.OOXML" publicKeyToken="0df73ec7942b34e1" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-1.0.0.999" newVersion="1.0.0.999" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>

+ 6 - 0
Executer/DataCheck/packages.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Newtonsoft.Json" version="10.0.1" targetFramework="net461" />
+  <package id="NPOI" version="2.3.0" targetFramework="net461" />
+  <package id="SharpZipLib" version="1.0.0" targetFramework="net461" />
+</packages>

BIN
Executer/DataExport/Dlls/RevitAPI.dll


BIN
Executer/DataExport/Dlls/RevitAPIUI.dll


BIN
Executer/DataExport/Dlls/RevitAddInUtility.dll


BIN
Executer/DataExport/Dlls/RevitNET.dll


BIN
Executer/DataExport/Dlls/SAGA.DotNetUtils.dll


BIN
Executer/DataExport/Dlls/SAGA.RevitAPI.dll


BIN
Executer/DataExport/Dlls/SAGA.RevitUtils.dll


+ 49 - 0
Executer/DataExport/JBIM.sln

@@ -0,0 +1,49 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26730.3
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JBIM", "JBIM\JBIM.csproj", "{A6A90BFE-126D-4499-860A-F0E2C40EBB23}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RevitExport", "RevitExport\RevitExport.csproj", "{825B43F4-1F7B-44AC-9BD4-501DE9422D32}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RevitToJBim", "RevitToJBim\RevitToJBim.csproj", "{F83397D2-C35A-4F5C-8DAF-E9DE1E2D2AD5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExportStart", "ExportStart\ExportStart.csproj", "{003C65AE-6802-4142-97FE-611C23E3676D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceDataCheck", "ServiceDataCheck\ServiceDataCheck.csproj", "{7B748B09-DC20-4406-85A3-101E7833F8CE}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{A6A90BFE-126D-4499-860A-F0E2C40EBB23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{A6A90BFE-126D-4499-860A-F0E2C40EBB23}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A6A90BFE-126D-4499-860A-F0E2C40EBB23}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{A6A90BFE-126D-4499-860A-F0E2C40EBB23}.Release|Any CPU.Build.0 = Release|Any CPU
+		{825B43F4-1F7B-44AC-9BD4-501DE9422D32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{825B43F4-1F7B-44AC-9BD4-501DE9422D32}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{825B43F4-1F7B-44AC-9BD4-501DE9422D32}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{825B43F4-1F7B-44AC-9BD4-501DE9422D32}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F83397D2-C35A-4F5C-8DAF-E9DE1E2D2AD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F83397D2-C35A-4F5C-8DAF-E9DE1E2D2AD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F83397D2-C35A-4F5C-8DAF-E9DE1E2D2AD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F83397D2-C35A-4F5C-8DAF-E9DE1E2D2AD5}.Release|Any CPU.Build.0 = Release|Any CPU
+		{003C65AE-6802-4142-97FE-611C23E3676D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{003C65AE-6802-4142-97FE-611C23E3676D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{003C65AE-6802-4142-97FE-611C23E3676D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{003C65AE-6802-4142-97FE-611C23E3676D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7B748B09-DC20-4406-85A3-101E7833F8CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7B748B09-DC20-4406-85A3-101E7833F8CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7B748B09-DC20-4406-85A3-101E7833F8CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7B748B09-DC20-4406-85A3-101E7833F8CE}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {6ADA978E-6CF2-4C12-AEAE-D090120BEBE2}
+	EndGlobalSection
+EndGlobal

+ 96 - 0
Executer/DataExport/JBIM/BimDocument.cs

@@ -0,0 +1,96 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:BimDocument
+ * 作者:xulisong
+ * 创建时间: 2019/6/13 11:01:06
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JBIM
+{
+    /// <summary>
+    /// Bim文件类信息
+    /// </summary>
+    public class BimDocument
+    {
+        public BimDocument()
+        {
+            BimObjects = new ReadOnlyCollection<BimObject>(m_InnerObjects = new List<BimObject>());
+        }
+
+        private List<BimObject> m_InnerObjects;
+        private Dictionary<BimId, BimObject> m_IndexObjects = new Dictionary<BimId, BimObject>();
+        /// <summary>
+        /// 关联所有对象
+        /// </summary>
+        public ReadOnlyCollection<BimObject> BimObjects { get; private set; }
+
+        /// <summary>
+        /// 当前索引信息
+        /// </summary>
+        private long CurrentIndex { get; set; } = 10000;
+        internal BimId GenerateId()
+        {
+            return new BimId((++CurrentIndex).ToString());
+        }
+
+        public BimObject NewObject(BimObject originObject)
+        {
+            if (originObject.Id != null)
+            {
+                return originObject;
+            }
+            originObject.Id = GenerateId();
+            AddObject(originObject);
+            return originObject;
+        }
+        /// <summary>
+        /// 增加预定义对象
+        /// </summary>
+        /// <param name="originObject"></param>
+        /// <returns></returns>
+        public bool AddPredefinedObject(BimObject originObject)
+        {
+            if (originObject.Id == null)
+            {
+                return false;
+            }
+
+            if (m_IndexObjects.TryGetValue(originObject.Id, out BimObject oldObject))
+            {
+                //移除信息
+                if (oldObject != null)
+                {
+                    m_InnerObjects.Remove(oldObject);
+                }               
+                m_IndexObjects[originObject.Id] = originObject;
+            }
+            else
+            {
+                AddObject(originObject);
+            }
+            return true;
+        }
+        private void AddObject(BimObject originObject)
+        {
+            this.m_InnerObjects.Add(originObject);
+            m_IndexObjects[originObject.Id] = originObject;
+        }
+
+        public BimObject GetBimObject(BimId id)
+        {
+            //查询可优化,简单的二分查找
+            if (m_IndexObjects.TryGetValue(id, out BimObject result))
+            {
+                return result;
+            }
+            return null;
+        }
+    }
+}

+ 74 - 0
Executer/DataExport/JBIM/BimId.cs

@@ -0,0 +1,74 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:BimId
+ * 作者:xulisong
+ * 创建时间: 2019/6/13 9:57:38
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JBIM
+{
+    /*
+     * 定义BimId类,初始化相关ID类型的引用
+     * 引入该类,是为了方便在Id这一类型上的扩展,毕竟它和普通的基本类型有所不同
+     */
+    /// <summary>
+    /// bimId类
+    /// </summary>
+    public class BimId
+    {
+        public BimId(string id)
+        {
+            this.Id = id;
+        }
+        /// <summary>
+        /// Id值
+        /// </summary>
+        public string Id { get; private set; }
+
+        public override string ToString()
+        {
+            return Id?.ToString() ?? string.Empty;
+        }
+        public override bool Equals(object obj)
+        {
+            if (obj is BimId inputId)
+            {
+                return Id == inputId.Id;
+
+            }
+            return false;
+        }
+        public override int GetHashCode()
+        {
+            if (string.IsNullOrWhiteSpace(Id))
+            {
+                return 0;
+            }
+
+            return Id.GetHashCode();
+        }
+        public static bool operator ==(BimId a, BimId b)
+        {
+            if ((object)a == null)
+            {
+                return (object)b == null;
+            }
+            return a.Equals(b);
+        }
+        public static bool operator !=(BimId a, BimId b)
+        {
+            if ((object)a == null)
+            {
+                return ((object)b != null);
+            }
+            return !a.Equals(b);
+        }
+
+    }
+}

+ 51 - 0
Executer/DataExport/JBIM/BimObject.cs

@@ -0,0 +1,51 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:BimObject
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 10:36:34
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM
+{
+    [TypeDefiniton(TypeDefinition.BimObject)]
+    public class BimObject
+    {
+        public BimObject()
+        {
+            ElementType = GetElementType();
+        }
+        public BimId Id { get; internal set; }
+        public string ElementType { get; protected set; }
+        /// <summary>
+        /// 附加信息,预留
+        /// </summary>
+        public string Tag { get; set; }
+        /// <summary>
+        /// 获取类型Type
+        /// </summary>
+        /// <returns></returns>
+        protected string GetElementType()
+        {
+            var attributes = this.GetType().GetCustomAttributes(typeof(TypeDefinitonAttribute), true);
+            string result = null;
+            if (attributes.Any())
+            {
+                result = (attributes[0] as TypeDefinitonAttribute)?.GetTypeDefiniton();
+            }
+
+            if (string.IsNullOrEmpty(result))
+            {
+                result = TypeDefinitonUtil.GetTypeDefiniton(TypeDefinition.BimObject);
+            }
+            return result;
+        }
+    }
+}

+ 68 - 0
Executer/DataExport/JBIM/Common/BimObjectUtil.cs

@@ -0,0 +1,68 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:BimObjectUtil
+ * 作者:xulisong
+ * 创建时间: 2019/6/18 15:13:11
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JBIM.Common
+{
+    public static class BimObjectUtil
+    {
+        public static void AcceptRelation<T>(BimObject bimObject, string property,T value)
+        {
+            var propertyInfo=ParseProperty(bimObject, property);
+            if (propertyInfo != null)
+            {
+                if (propertyInfo.PropertyType.IsInstanceOfType(value))
+                {
+                    propertyInfo.SetValue(bimObject, value);
+                }
+            }
+        }
+        /// <summary>
+        /// 增加单关联信息
+        /// </summary>
+        /// <param name="bimObject"></param>
+        /// <param name="property"></param>
+        /// <param name="value"></param>
+        public static void AcceptRelation(BimObject bimObject, string property, BimId value)
+        {
+            AcceptRelation<BimId>(bimObject, property, value);
+        }
+        /// <summary>
+        /// 增加一对多关联信息
+        /// </summary>
+        /// <param name="bimObject"></param>
+        /// <param name="property"></param>
+        /// <param name="value"></param>
+        public static void AcceptRelations(BimObject bimObject, string property,List<BimId> value)
+        {
+            AcceptRelation<List<BimId>>(bimObject, property, value);
+        }
+        private static PropertyInfo ParseProperty(BimObject bimObject,string pName)
+        {
+            var type = bimObject.GetType();
+            string propertyName = pName;
+            var key = type.FullName + "_" + propertyName;
+            var propertyInfo = PropertyCache.GetProperty(key);
+            if (propertyInfo == null)
+            {
+                //缓存解析出来的属性元数据,以便提高解析速度
+                propertyInfo = type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public);
+                if(propertyInfo!=null)
+                {
+                    PropertyCache.SetProperty(key, propertyInfo);
+                }
+            }
+            return propertyInfo;
+        }
+    }
+}

+ 37 - 0
Executer/DataExport/JBIM/Common/EnumExtensions.cs

@@ -0,0 +1,37 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:EnumExtensions
+ * 作者:xulisong
+ * 创建时间: 2019/6/17 10:43:13
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System.ComponentModel;
+using System.Reflection;
+
+namespace JBIM.Common
+{
+    public static class EnumExtensions
+    {
+        /// <summary>
+        /// 获取指定枚举类型的描述值
+        /// </summary>
+        /// <typeparam name="T">枚举类型</typeparam>
+        /// <returns></returns>
+        public static string GetDescription<T>(this T t) where T : struct
+        {
+            string description = t.ToString();
+            FieldInfo fieldInfo = t.GetType().GetField(description);
+            object[] attributes = fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false);
+            if (attributes.Length > 0)
+            {
+                DescriptionAttribute info = attributes[0] as DescriptionAttribute;
+                if (info != null)
+                {
+                    description = info.Description;
+                }
+
+            }
+            return description;
+        }
+    }
+}

+ 37 - 0
Executer/DataExport/JBIM/Common/PropertyCache.cs

@@ -0,0 +1,37 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:PropertyCache
+ * 作者:xulisong
+ * 创建时间: 2019/6/17 10:04:51
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System.Collections.Generic;
+using System.Reflection;
+
+namespace JBIM.Common
+{
+    public static class PropertyCache
+    {
+        private static readonly Dictionary<string, PropertyInfo> m_CacheProperties = new Dictionary<string, PropertyInfo>();
+
+        /// <summary>
+        /// 设置指定键值的属性
+        /// </summary>
+        /// <param name="key"></param>
+        /// <param name="propertyInfo"></param>
+        public static void SetProperty(string key, PropertyInfo propertyInfo)
+        {
+            m_CacheProperties[key] = propertyInfo;
+        }
+        /// <summary>
+        /// 获取指定键值的属性
+        /// </summary>
+        /// <param name="key"></param>
+        /// <returns></returns>
+        public static PropertyInfo GetProperty(string key)
+        {
+            m_CacheProperties.TryGetValue(key, out PropertyInfo result);
+            return result;
+        }
+    }
+}

+ 34 - 0
Executer/DataExport/JBIM/Common/TypeDefinitonAttribute.cs

@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:TypeDefinitonAttribute
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 11:26:04
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Definition;
+
+namespace JBIM.Common
+{
+    [AttributeUsage(AttributeTargets.Class)]
+    public class TypeDefinitonAttribute:Attribute
+    {
+        /*
+         * 由于可能扩展相关TypeDefiniton的生成方式,所以以方法形式返回需要值
+         */
+        private TypeDefinition m_TypeDefintion;
+        public TypeDefinitonAttribute(TypeDefinition typeDefinition)
+        {
+            m_TypeDefintion = typeDefinition;
+        }
+
+        public virtual string GetTypeDefiniton()
+        {
+            return TypeDefinitonUtil.GetTypeDefiniton(m_TypeDefintion);
+        }
+    }
+}

+ 25 - 0
Executer/DataExport/JBIM/Common/TypeDefinitonUtil.cs

@@ -0,0 +1,25 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:TypeDefinitonUtil
+ * 作者:xulisong
+ * 创建时间: 2019/6/13 11:31:46
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Definition;
+
+namespace JBIM.Common
+{
+    public static class TypeDefinitonUtil
+    {
+        public static string GetTypeDefiniton(TypeDefinition typeDefinition)
+        {
+            return typeDefinition.ToString();
+        }
+
+    }
+}

+ 34 - 0
Executer/DataExport/JBIM/Component/BoundarySegment.cs

@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:BoundarySegment
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 11:51:21
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.BoundarySegment)]
+    public class BoundarySegment:BimObject
+    {
+        public BoundarySegment()
+        {
+            Curve = new List<XYZ>();
+        }
+        /// <summary>
+        /// 参照元素
+        /// </summary>
+        public BimId Reference { get; set; }
+        /// <summary>
+        /// 关联线
+        /// </summary>
+        public List<XYZ> Curve { get; private set; }
+    }
+}

+ 27 - 0
Executer/DataExport/JBIM/Component/Column.cs

@@ -0,0 +1,27 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:Column
+ * 作者:xulisong
+ * 创建时间: 2019/6/24 9:26:43
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.Column)]
+    public class Column : VisibleComponentObject
+    {
+        //是否加上,建筑结构,是否是房间判断等枚举
+        /// <summary>
+        /// 是否是房间边界
+        /// </summary>
+        public bool RoomBoundary { get; set; } = true;
+    }
+}

+ 38 - 0
Executer/DataExport/JBIM/Component/ComponentObject.cs

@@ -0,0 +1,38 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:ComponentObject
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 10:41:01
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JBIM.Component
+{
+    /// <summary>
+    /// 构件对象
+    /// </summary>
+    public class ComponentObject:BimObject
+    {
+        /// <summary>
+        /// 数据来源Id
+        /// </summary>
+        public string SourceId { get; set; }
+        /// <summary>
+        /// 构件名称
+        /// </summary>
+        public string Name { get; set; }
+        /// <summary>
+        /// 构件关联类型Id
+        /// </summary>
+        public BimId TypeId { get; set; }
+        /// <summary>
+        /// 从模型中拾取的参数
+        /// </summary>
+        public List<Parameter> Parameters { get; set; }
+    }
+}

+ 61 - 0
Executer/DataExport/JBIM/Component/Connector.cs

@@ -0,0 +1,61 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:Connector
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 11:04:03
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    /// <summary>
+    /// Connector信息
+    /// </summary>
+    [TypeDefiniton(TypeDefinition.Connector)]
+    public class Connector:ComponentObject
+    {
+        public Connector()
+        {
+            ConnectedIds = new List<BimId>();
+        }
+        /// <summary>
+        /// Connector所属专业域
+        /// </summary>
+        public string Domain { get; set; }
+        /// <summary>
+        /// 定位点
+        /// </summary>
+        public XYZ Origin { get; set; }
+        /// <summary>
+        /// 信息描述
+        /// </summary>
+        public string Description { get; set; }
+        /// <summary>
+        /// 是否连接
+        /// </summary>
+        public bool IsConnected { get; set; }
+        /// <summary>
+        /// Connector所属构件
+        /// </summary>
+        public BimId Owner { get; set; }
+        /// <summary>
+        /// Connector连接的connectorId
+        /// </summary>
+        public List<BimId> ConnectedIds { get;private set; }
+        ///// <summary>
+        ///// connector关联的系统实例
+        ///// </summary>
+        //public BimId MepSystem { get; set; }
+        ///// <summary>
+        ///// 关联系统类型名称
+        ///// </summary>
+        public string MepSystemTypeName { get; set; }
+    }
+}

+ 26 - 0
Executer/DataExport/JBIM/Component/Door.cs

@@ -0,0 +1,26 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:Door
+ * 作者:xulisong
+ * 创建时间: 2019/6/25 14:58:57
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using JBIM.Common;
+using JBIM.Definition;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.Door)]
+    public class Door : VisibleComponentObject
+    {
+        public BimId Owner { get; set; }
+        public XYZ FaceDirection { get; set; }
+        public XYZ HandDirection { get; set; }
+        public double Thick { get; set; }
+    }
+}

+ 57 - 0
Executer/DataExport/JBIM/Component/Duct.cs

@@ -0,0 +1,57 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:Duct
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 11:10:06
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    /// <summary>
+    /// 风管类型
+    /// </summary>
+    [TypeDefiniton(TypeDefinition.Duct)]
+    public class Duct:VisibleComponentObject
+    {
+        public Duct()
+        {
+            ConnectedIds = new List<BimId>();
+        }
+        ///// <summary>
+        ///// connector关联的系统实例
+        ///// </summary>
+        //public BimId MepSystem { get; set; }
+        ///// <summary>
+        ///// 关联系统类型名称
+        ///// </summary>
+        public string MepSystemTypeName { get; set; }
+        /// <summary>
+        /// Connector连接的connectorIds
+        /// </summary>
+        public List<BimId> ConnectedIds { get; private set; }
+        /// <summary>
+        /// 风管形状
+        /// </summary>
+        public DuctShape Shape { get; set; }
+        /// <summary>
+        /// 直径
+        /// </summary>
+        public double Diameter { get; set; }
+        /// <summary>
+        /// 宽度
+        /// </summary>
+        public double Width { get; set; }
+        /// <summary>
+        /// 高度
+        /// </summary>
+        public double Height { get; set; }
+    }
+}

+ 30 - 0
Executer/DataExport/JBIM/Component/EquipPart.cs

@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:部件
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 14:11:03
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.EquipPart)]
+    public class EquipPart : Equipment
+    {
+        public EquipPart()
+        {
+         
+        }
+        /// <summary>
+        /// 关联的设备
+        /// </summary>
+        public string Owner { get; set; }
+    }
+}

+ 31 - 0
Executer/DataExport/JBIM/Component/Equipment.cs

@@ -0,0 +1,31 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:设备
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 14:11:03
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.Equipment)]
+    public class Equipment : VisibleComponentObject
+    {
+        public Equipment()
+        {
+            
+        }
+
+        /// <summary>
+        /// 族名称
+        /// </summary>
+        public string FamilyName { get; set; }
+    }
+}

+ 24 - 0
Executer/DataExport/JBIM/Component/Grid.cs

@@ -0,0 +1,24 @@
+/* ==============================================================================
+ * 功能描述:Grid  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/26 15:01:34
+ * ==============================================================================*/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Component;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    /// <summary>
+    /// Grid
+    /// </summary>
+    [TypeDefiniton(TypeDefinition.Grid)]
+    public class Grid: VisibleComponentObject
+    {
+    }
+}

+ 25 - 0
Executer/DataExport/JBIM/Component/Level.cs

@@ -0,0 +1,25 @@
+/* ==============================================================================
+ * 功能描述:Level  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/26 15:01:44
+ * ==============================================================================*/
+using JBIM.Definition;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+
+namespace JBIM.Component
+{
+    /// <summary>
+    /// Level
+    /// </summary>
+    [TypeDefiniton(TypeDefinition.Level)]
+    public class Level:VisibleComponentObject
+    {
+        //标高的高度
+        public double Value { get; set; }
+    }
+}

+ 25 - 0
Executer/DataExport/JBIM/Component/MepSystem.cs

@@ -0,0 +1,25 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:MepSystem
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 11:00:35
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    /// <summary>
+    /// mep系统相关
+    /// </summary>
+    [TypeDefiniton(TypeDefinition.MepSystem)]
+    public class MepSystem: ComponentObject
+    {
+    }
+}

+ 22 - 0
Executer/DataExport/JBIM/Component/MepSystemType.cs

@@ -0,0 +1,22 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:MepSystemType
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 11:03:47
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.MepSystemType)]
+    public class MepSystemType : ComponentObject
+    {
+    }
+}

+ 30 - 0
Executer/DataExport/JBIM/Component/OtherJoinObject.cs

@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:OtherJoinObject
+ * 作者:xulisong
+ * 创建时间: 2019/6/24 9:25:47
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.Other)]
+    public class OtherJoinObject : VisibleComponentObject
+    {
+        public OtherJoinObject()
+        {
+            ConnectedIds = new List<BimId>();
+        }
+        /// <summary>
+        /// Connector连接的connectorIds
+        /// </summary>
+        public List<BimId> ConnectedIds { get; private set; }
+    }
+}

+ 29 - 0
Executer/DataExport/JBIM/Component/Parameter.cs

@@ -0,0 +1,29 @@
+/* ==============================================================================
+ * 功能描述:Parameter  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/21 17:29:09
+ * ==============================================================================*/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JBIM.Component
+{
+    /// <summary>
+    /// Parameter
+    /// </summary>
+    public class Parameter
+    {
+        public Parameter(ParameterDefinition define)
+        {
+            Definition = define;
+        }
+        
+        public ParameterDefinition Definition { get; set; }
+
+        public string Value { get; set; }
+        
+    }
+}

+ 41 - 0
Executer/DataExport/JBIM/Component/ParameterDefinition.cs

@@ -0,0 +1,41 @@
+/* ==============================================================================
+ * 功能描述:ParameterDefinition  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/22 13:03:46
+ * ==============================================================================*/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JBIM.Component
+{
+    /// <summary>
+    /// ParameterDefinition
+    /// </summary>
+    public class ParameterDefinition
+    {
+        public string Id { get; set; }
+        public string Name { get; set; }
+        /// <summary>
+        /// 参数类型:Test,Area,Number,etc
+        /// </summary>
+        public ParameterType ParameterType { get; set; }
+
+        public bool Visible { get; set; }
+       
+    }
+
+    public enum ParameterType
+    {
+        Invalid=-1,
+        Text=0,
+        Integer,
+        Number,
+        Length,
+        Area,
+        Volume,
+        Angle
+    }
+}

+ 42 - 0
Executer/DataExport/JBIM/Component/Pipe.cs

@@ -0,0 +1,42 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:Pipe
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 11:09:56
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.Pipe)]
+    public class Pipe:VisibleComponentObject
+    {
+        public Pipe()
+        {
+            ConnectedIds = new List<BimId>();
+        }
+        /// <summary>
+        /// Connector连接的connectorIds
+        /// </summary>
+        public List<BimId> ConnectedIds { get; private set; }
+        ///// <summary>
+        ///// connector关联的系统实例
+        ///// </summary>
+        //public BimId MepSystem { get; set; }
+        ///// <summary>
+        ///// 关联系统类型名称
+        ///// </summary>
+        public string MepSystemTypeName { get; set; }
+        /// <summary>
+        /// 管道直径
+        /// </summary>
+        public double Diameter { get; set; }
+    }
+}

+ 27 - 0
Executer/DataExport/JBIM/Component/Space.cs

@@ -0,0 +1,27 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:Space
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 14:11:03
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.Space)]
+    public class Space:VisibleComponentObject
+    {
+        public Space()
+        {
+            BoundarySegments = new List<List<BimId>>();
+        }
+        public List<List<BimId>> BoundarySegments { get; private set; }
+    }
+}

+ 25 - 0
Executer/DataExport/JBIM/Component/Unit.cs

@@ -0,0 +1,25 @@
+/* ==============================================================================
+ * 功能描述:Unit  
+ * 创 建 者:Garrett
+ * 创建日期:2019/6/26 15:02:34
+ * ==============================================================================*/
+using JBIM.Definition;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Common;
+
+namespace JBIM.Component
+{
+    /// <summary>
+    /// Unit
+    /// </summary>
+    [TypeDefiniton(TypeDefinition.Unit)]
+    public class Unit:ComponentObject
+    {
+        //单位的值
+        public string Value { get; set; }
+    }
+}

+ 22 - 0
Executer/DataExport/JBIM/Component/VirtualWall.cs

@@ -0,0 +1,22 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:VirtualWall
+ * 作者:xulisong
+ * 创建时间: 2019/6/25 14:55:40
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using JBIM.Common;
+using JBIM.Definition;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.VirtualWall)]
+    public class VirtualWall : VisibleComponentObject
+    {
+    }
+}

+ 36 - 0
Executer/DataExport/JBIM/Component/VisibleComponentObject.cs

@@ -0,0 +1,36 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:VisibleComponentObject
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 10:44:44
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using JBIM.Definition;
+
+namespace JBIM.Component
+{
+    /// <summary>
+    /// 可见构件
+    /// </summary>
+    public class VisibleComponentObject:ComponentObject
+    {
+        public VisibleComponentObject()
+        {
+            //Location = new List<XYZ>();
+            OutLine = new List<Polygon>();
+        }
+        /// <summary>
+        /// 定位信息
+        /// </summary>
+        public GeometryLocation Location { get;  set; }
+        /// <summary>
+        /// 轮廓信息
+        /// </summary>
+        public List<Polygon> OutLine { get; private set; }
+    }
+}

+ 26 - 0
Executer/DataExport/JBIM/Component/Wall.cs

@@ -0,0 +1,26 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:Wall
+ * 作者:xulisong
+ * 创建时间: 2019/6/25 14:55:22
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using JBIM.Common;
+using JBIM.Definition;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.Wall)]
+    public class Wall : VisibleComponentObject
+    {
+        /// <summary>
+        /// 墙宽
+        /// </summary>
+        public double Width { get; set; }
+    }
+}

+ 24 - 0
Executer/DataExport/JBIM/Component/Window.cs

@@ -0,0 +1,24 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:Window
+ * 作者:xulisong
+ * 创建时间: 2019/6/25 14:58:42
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using JBIM.Common;
+using JBIM.Definition;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JBIM.Component
+{
+    [TypeDefiniton(TypeDefinition.Window)]
+    public class Window : VisibleComponentObject
+    {
+        public BimId Owner { get; set; }
+        public double Thick { get; set; }
+    }
+}

+ 36 - 0
Executer/DataExport/JBIM/Definition/ConnectorShape.cs

@@ -0,0 +1,36 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:ConnectorShape
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 10:24:24
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+namespace JBIM.Definition
+{
+    /// <summary>
+    /// 连接点形状
+    /// </summary>
+    public enum ConnectorShape
+    {
+        Undefine = 0,
+        Circle=1,
+        Rectangle=2,
+        Ellipse=3
+    }
+    /// <summary>
+    /// 风管形状
+    /// </summary>
+    public enum DuctShape
+    {
+        Circle=0,
+        Rectangle=1,
+        Ellipse=2
+    }
+
+    public enum ConnectorDomain
+    {
+        DomainUndefined=0,
+        DomainPiping =1,
+        DomainHvac,
+    }
+}

+ 46 - 0
Executer/DataExport/JBIM/Definition/GeometryLocation.cs

@@ -0,0 +1,46 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:GeometryLocation
+ * 作者:xulisong
+ * 创建时间: 2019/6/19 16:43:58
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System.Collections.Generic;
+
+namespace JBIM.Definition
+{
+    /// <summary>
+    /// 定位类型
+    /// </summary>
+    public enum LocationType
+    {
+        Point=0,
+        Line,
+        Arc,
+        Common
+    }
+    public class GeometryLocation
+    {
+        public GeometryLocation(LocationType type)
+        {
+            Type = type;
+            Points = new List<XYZ>();
+        }
+        public LocationType Type { get; set; }
+        public List<XYZ> Points { get;private set; }
+
+        public static GeometryLocation CreatePointLocation(XYZ xyz)
+        {
+            var result = new GeometryLocation(LocationType.Point);
+            result.Points.Add(xyz);
+            return result;
+        }
+
+        public static GeometryLocation CreateLineLocation(List<XYZ> xyzes)
+        {
+            var result = new GeometryLocation(LocationType.Line);
+            result.Points.AddRange(xyzes);
+            return result;
+        }
+    }
+}

+ 80 - 0
Executer/DataExport/JBIM/Definition/TypeDefinition.cs

@@ -0,0 +1,80 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:TypeDefinition
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 10:12:56
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System.ComponentModel;
+
+namespace JBIM.Definition
+{
+    /*
+      类型Id范围:[-10000,-19999)
+      {Id:"xxxxxx",ElementType:"Connector"}
+      //或者硬编码成枚举,或者使用配置文件存储
+     */
+    /// <summary>
+    /// 类型定义
+    /// </summary>
+    public enum TypeDefinition
+    {
+        [Description("BimObject")]
+        BimObject = -10000,
+        [Description("Connector")]
+        Connector,
+        [Description("Duct")]
+        Duct ,
+        [Description("Pipe")]
+        Pipe ,
+        [Description("Space")]
+        Space,
+        [Description("MepSystem")]
+        MepSystem,
+        [Description("MepSystemType")]
+        MepSystemType ,
+        [Description("BoundarySegment")]
+        BoundarySegment,
+        [Description("Equipment")]
+        Equipment,
+        [Description("EquipPart")]
+        EquipPart,
+        [Description("Column")]
+        Column,
+
+        [Description("Wall")]
+        Wall,
+        [Description("VirtualWall")]
+        VirtualWall,
+        [Description("Window")]
+        Window,
+        [Description("Door")]
+        Door,
+        [Description("Other")]
+        Other,
+
+        [Description("Unit")]
+        Unit,
+        [Description("Grid")]
+        Grid,
+        [Description("Level")]
+        Level,
+
+        #region 关系类型相关
+        [Description("Relationship")]
+        Relationship = -25000,
+        [Description("MepSystem")]
+        Property_MepSystem ,
+        [Description("Owner")]
+        Property_Owner,
+        [Description("TypeId")]
+        Property_TypeId ,
+        [Description("ConnectedIds")]
+        Property_ConnectedIds,
+        [Description("Host")]
+        Property_Host ,
+        [Description("Reference")]
+        Property_Reference,
+        #endregion
+    }
+}

+ 40 - 0
Executer/DataExport/JBIM/Definition/XYZ.cs

@@ -0,0 +1,40 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:XYZ
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 10:46:22
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System.Collections.Generic;
+
+namespace JBIM.Definition
+{
+    public class XYZ
+    {
+        public double X { get; set; }
+        public double Y { get; set; }
+        public double Z { get; set; }
+
+        public override string ToString()
+        {
+            return $"{X},{Y},{Z}";
+        }
+    }
+    public class XY
+    {
+        public double X { get; set; }
+        public double Y { get; set; }
+    }
+
+    public class Polygon : List<XYZ>
+    {
+        public Polygon()
+        {
+
+        }
+        public Polygon(IEnumerable<XYZ> collection):base(collection)
+        {
+
+        }
+    }
+}

+ 19 - 0
Executer/DataExport/JBIM/Geometry/GeometryObject.cs

@@ -0,0 +1,19 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:GeometryObject
+ * 作者:xulisong
+ * 创建时间: 2019/6/12 10:37:00
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JBIM.Geometry
+{
+    public class GeometryObject: BimObject
+    {
+    }
+}

+ 116 - 0
Executer/DataExport/JBIM/JBIM.csproj

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{A6A90BFE-126D-4499-860A-F0E2C40EBB23}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <RootNamespace>JBIM</RootNamespace>
+    <AssemblyName>JBIM</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <WarningLevel>4</WarningLevel>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\OutputDll\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\OutputDll\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <StartupObject />
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Xaml">
+      <RequiredTargetFramework>4.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="WindowsBase" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="BimDocument.cs" />
+    <Compile Include="BimId.cs" />
+    <Compile Include="BimObject.cs" />
+    <Compile Include="Common\BimObjectUtil.cs" />
+    <Compile Include="Common\EnumExtensions.cs" />
+    <Compile Include="Common\PropertyCache.cs" />
+    <Compile Include="Common\TypeDefinitonAttribute.cs" />
+    <Compile Include="Common\TypeDefinitonUtil.cs" />
+    <Compile Include="Component\BoundarySegment.cs" />
+    <Compile Include="Component\Column.cs" />
+    <Compile Include="Component\ComponentObject.cs" />
+    <Compile Include="Component\Connector.cs" />
+    <Compile Include="Component\Door.cs" />
+    <Compile Include="Component\Duct.cs" />
+    <Compile Include="Component\Grid.cs" />
+    <Compile Include="Component\Level.cs" />
+    <Compile Include="Component\MepSystem.cs" />
+    <Compile Include="Component\MepSystemType.cs" />
+    <Compile Include="Component\OtherJoinObject.cs" />
+    <Compile Include="Component\Parameter.cs" />
+    <Compile Include="Component\ParameterDefinition.cs" />
+    <Compile Include="Component\Pipe.cs" />
+    <Compile Include="Component\EquipPart.cs" />
+    <Compile Include="Component\Equipment.cs" />
+    <Compile Include="Component\Space.cs" />
+    <Compile Include="Component\Unit.cs" />
+    <Compile Include="Component\VirtualWall.cs" />
+    <Compile Include="Component\VisibleComponentObject.cs" />
+    <Compile Include="Component\Wall.cs" />
+    <Compile Include="Component\Window.cs" />
+    <Compile Include="Definition\ConnectorShape.cs" />
+    <Compile Include="Definition\GeometryLocation.cs" />
+    <Compile Include="Definition\XYZ.cs" />
+    <Compile Include="Geometry\GeometryObject.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <Compile Include="Definition\TypeDefinition.cs" />
+    <Compile Include="Relationship\OneToManyRel.cs" />
+    <Compile Include="Relationship\OneToOneRel.cs" />
+    <Compile Include="Relationship\RelationshipBase.cs" />
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <ItemGroup />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 6 - 0
Executer/DataExport/JBIM/JBIM.csproj.user

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectView>ProjectFiles</ProjectView>
+  </PropertyGroup>
+</Project>

+ 0 - 0
Executer/DataExport/JBIM/Properties/AssemblyInfo.cs


Неке датотеке нису приказане због велике количине промена