瀏覽代碼

mxg:处理丽泽特殊空间,面积为零,仅由一条弧围成

mengxiangge 5 年之前
父節點
當前提交
e03310d254

+ 4 - 4
MBI/MBIResource/Config/HttpSetting - 测试.ini

@@ -2,9 +2,9 @@
 SaasLocalHost = http://192.168.30.96:8080/
 DataPlatformLocalHost = http://192.168.20.225:8080/
 ScanBuildingLocalHost = http://192.168.20.235:8080/ScanBuilding/
-Html5ImageLocalHost = http://172.16.0.181:8890/
-Html5DetailLocalHost = http://172.16.0.181:8889/#/
-Html5ScanLocalHost = http://172.16.0.181:8888/#/
+Html5ImageLocalHost = http://192.168.20.215:8890/
+Html5DetailLocalHost = http://192.168.20.215:8889/#/
+Html5ScanLocalHost = http://192.168.20.215:8888/#/
 OssClientFileKey = test/files/revit/
 GoodHandLocalHost = http://192.168.20.225:8080/godhand/
 GplotViewHost = http://mbi.sagacloud.cn:8888/#/
@@ -14,4 +14,4 @@ VenderAddress=http://192.168.20.225:8080/venders
 DependencyAddress=http://192.168.20.225:8080/venders-dp
 EquipmentFamilyAddress=http://192.168.20.225:8080/data-platform-3
 FileAddress=http://192.168.30.96:8080
-H5Address=http://172.16.0.181:8889/#
+H5Address=http://192.168.20.215:8889/#

+ 1 - 1
MBI/Menu/TopolgyTool.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Menus>
   <App>
-    <AppIndex>3</AppIndex>
+    <AppIndex>5</AppIndex>
     <AppName>SAGA</AppName>
   </App>
   <Tab TabName="拓扑工具">

+ 9 - 9
MBI/SAGA.GplotManage/TopologyApplicationCommand.cs

@@ -68,16 +68,16 @@ namespace SAGA.GplotManage
                 return Result.Succeeded;
             }
 
-            Stopwatch watch = new Stopwatch();
-            watch.Start();
-            for (int i = 0; i < 4*300*2300; i++)
-            {
-                Line.CreateBound(new XYZ(0, 0,0), new XYZ(100, 100,100));
-            }
+            //Stopwatch watch = new Stopwatch();
+            //watch.Start();
+            //for (int i = 0; i < 4*300*2300; i++)
+            //{
+            //    Line.CreateBound(new XYZ(0, 0,0), new XYZ(100, 100,100));
+            //}
 
-            watch.Stop();
-            MessageShowBase.Confirm(watch.ElapsedMilliseconds.ToString());
-            //SpaceAirSupplyHandler.ShellExecute();
+            //watch.Stop();
+            //MessageShowBase.Confirm(watch.ElapsedMilliseconds.ToString());
+            SpaceAirSupplyHandler.ShellExecute();
             //MessageShow.Infomation("完成");
             return Result.Succeeded;
         }

+ 3 - 2
MBI/SAGA.MBI/Interaction/MBIModelInfoUpload.cs

@@ -7,6 +7,7 @@ using System.Threading.Tasks;
 using Autodesk.Revit.DB;
 using SAGA.DotNetUtils;
 using SAGA.DotNetUtils.Extend;
+using SAGA.DotNetUtils.Logger;
 using SAGA.MBI.Calc;
 using SAGA.MBI.Common;
 using SAGA.MBI.DataArrange;
@@ -95,9 +96,9 @@ namespace SAGA.MBI.Interaction
                     var flag=MBIModelInfoUpload.UploadMbiInfo(floorId);
                     results[floorId] = flag;
                 }
-                catch (Exception)
+                catch (Exception ex)
                 {
-
+                    Log4Net.Debug(ex.StackTrace+"\r\n"+ex.Message);
                 }
                 finally
                 {

+ 18 - 9
MBI/SAGA.MBI/RevitExport/SpaceSortUtils.cs

@@ -15,6 +15,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using SAGA.DotNetUtils.Logger;
 
 namespace SAGA.MBI.RevitExport
 {
@@ -32,7 +33,7 @@ namespace SAGA.MBI.RevitExport
                 CalcLevel(spaceDecorator, decorators);
             }
 
-            decorators=decorators.OrderByDescending(s => s.Level).ToList();
+            decorators = decorators.OrderByDescending(s => s.Level).ToList();
             return decorators.Select(sd => sd.Space).ToList();
         }
 
@@ -49,7 +50,7 @@ namespace SAGA.MBI.RevitExport
             }
             var useLevel = 0;
             try
-            {                
+            {
                 var containsSpaces = new List<SpaceDecorator>();
                 foreach (SpaceDecorator item in decorators)
                 {
@@ -62,10 +63,10 @@ namespace SAGA.MBI.RevitExport
                     {
                         containsSpaces.Add(item);
                     }
-                }              
+                }
                 foreach (var item in containsSpaces)
                 {
-                    var tempLevel = CalcLevel(item, decorators)+1;
+                    var tempLevel = CalcLevel(item, decorators) + 1;
                     useLevel = Math.Max(useLevel, tempLevel);
                 }
                 return useLevel;
@@ -82,7 +83,7 @@ namespace SAGA.MBI.RevitExport
         /// <param name="aFSpace"></param>
         /// <param name="bSpace"></param>
         /// <returns></returns>
-        private static bool  IsContains(SpaceDecorator aFSpace, SpaceDecorator bSpace)
+        private static bool IsContains(SpaceDecorator aFSpace, SpaceDecorator bSpace)
         {
             bool flag = false;
             if (aFSpace.Annular == null || bSpace.Annular == null)
@@ -90,8 +91,8 @@ namespace SAGA.MBI.RevitExport
                 return flag;
             }
 
-            var basePolygon = aFSpace.Annular.OutPolygon;
-            var refPolygon = bSpace.Annular.OutPolygon;
+            var basePolygon = aFSpace.Annular?.OutPolygon;
+            var refPolygon = bSpace.Annular?.OutPolygon;
             if (basePolygon == null || refPolygon == null)
             {
                 return flag;
@@ -124,7 +125,7 @@ namespace SAGA.MBI.RevitExport
         public SpaceDecorator(Space space)
         {
             Space = space;
-            var mySegments = space.GetBoundarySegments(new SpatialElementBoundaryOptions());     
+            var mySegments = space.GetBoundarySegments(new SpatialElementBoundaryOptions());
             Annular = InitAnnular(mySegments);
         }
         public Space Space { get; private set; }
@@ -163,7 +164,15 @@ namespace SAGA.MBI.RevitExport
                 {
                     #region 外轮廓处理,默认逆时针
 
-                    annumlar = new Annular(new Polygon(usePoints));
+                    try
+                    {
+                        //特殊情况下空间边界由
+                        annumlar = new Annular(new Polygon(usePoints));
+                    }
+                    catch (Exception e)
+                    {
+                        Log4Net.Debug(e.Message + "\r\n" + e.StackTrace);
+                    }
 
                     #endregion
                 }

+ 3 - 1
MBI/SAGA.RevitUtils/Extends/SpaceExtend.cs

@@ -188,8 +188,10 @@ namespace SAGA.RevitUtils.Extends
         {
             //周长
             double perimeter = space.Perimeter;
+            //面积
+            double area = space.Area;
             //空间比较特殊,周长为零就相当于删除
-            return  (perimeter.IsZero());
+            return  (perimeter.IsZero()||area.IsZero());
         }
 
     }