Selaa lähdekoodia

Merge branch 'master' of https://git.dev.tencent.com/xuhuo1234/saga

mengxiangge 6 vuotta sitten
vanhempi
commit
60c9065598

+ 26 - 39
MBI/SAGA.GplotManage/GplotCommand.cs

@@ -1,15 +1,10 @@
 
 using System.Collections.Generic;
 using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading;
 using Autodesk.Revit.Attributes;
 using Autodesk.Revit.DB;
-using Autodesk.Revit.DB.Plumbing;
 using Autodesk.Revit.UI;
 using Newtonsoft.Json;
-using SAGA.GplotDrawData;
 using SAGA.GplotDrawData.View;
 using SAGA.GplotManage.UploadRelated;
 using SAGA.GplotRelationComputerManage;
@@ -66,9 +61,7 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
-            List<string> useRelations = RelationTypeManager.GetSystemRelationTypeNames();
-            SystemComputerHandler handler1 = new SystemComputerHandler();
-            handler1.ComputerWidthCache(useRelations);
+            SystemComputerHandler.ComputerAllRelations();
             WinSystem floorWin = new WinSystem(GplotShowType.ViewPlan);
             floorWin.Show();
             return Result.Succeeded;
@@ -81,7 +74,7 @@ namespace SAGA.GplotManage
     }
 
     /// <summary>
-    /// 冷冻水计算--平面回水
+    /// 系统平面信息
     /// </summary>
     [Transaction(TransactionMode.Manual)]
     [Regeneration(RegenerationOption.Manual)]
@@ -89,9 +82,7 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
-            List<string> useRelations = RelationTypeManager.GetSystemRelationTypeNames(); 
-            SystemComputerHandler handler1 = new SystemComputerHandler();
-            handler1.ComputerWidthCache(useRelations);
+            SystemComputerHandler.ComputerAllRelations();
             WinSystem floorWin = new WinSystem(GplotShowType.ViewPlan);
             floorWin.Show();
             return Result.Succeeded;
@@ -104,7 +95,7 @@ namespace SAGA.GplotManage
     }
 
     /// <summary>
-    /// 冷冻水计算--立面
+    /// 系统立面信息
     /// </summary>
     [Transaction(TransactionMode.Manual)]
     [Regeneration(RegenerationOption.Manual)]
@@ -112,9 +103,7 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
-            List<string> useRelations = RelationTypeManager.GetSystemRelationTypeNames(); 
-            SystemComputerHandler handler1 = new SystemComputerHandler();
-            handler1.ComputerWidthCache(useRelations);
+            SystemComputerHandler.ComputerAllRelations();
             WinSystem verticalWin = new WinSystem(GplotShowType.VerticalPlan);
             verticalWin.Show();
             return Result.Succeeded;
@@ -128,6 +117,26 @@ namespace SAGA.GplotManage
     }
 
     /// <summary>
+    /// 机房信息
+    /// </summary>
+    [Transaction(TransactionMode.Manual)]
+    [Regeneration(RegenerationOption.Manual)]
+    public class ChillWaterLoopRoom : ExternalCommand
+    {
+        public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
+        {
+            SystemComputerHandler.ComputerAllRelations();
+            WinMachineRoom room = new WinMachineRoom();
+            room.Show();
+            return Result.Succeeded;
+        }
+
+        public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
+        {
+            return true;
+        }
+    }
+    /// <summary>
     /// 拓扑图上传测试
     /// </summary>
     [Transaction(TransactionMode.Manual)]
@@ -217,27 +226,5 @@ namespace SAGA.GplotManage
             return true;
         }
     }
-    /// <summary>
-    /// 冷战测试
-    /// </summary>
-    [Transaction(TransactionMode.Manual)]
-    [Regeneration(RegenerationOption.Manual)]
-    public class ChillWaterLoopRoom : ExternalCommand
-    {
-        public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
-        {
-           // List<string> useRelations = new List<string>() { "ChillWaterLoop" };
-            List<string> useRelations = RelationTypeManager.GetSystemRelationTypeNames();
-            SystemComputerHandler handler1 = new SystemComputerHandler();
-            handler1.ComputerWidthCache(useRelations);
-            WinMachineRoom room = new WinMachineRoom();
-            room.Show();
-            return Result.Succeeded;
-        }
-
-        public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
-        {
-            return true;
-        }
-    }
+  
 }

+ 12 - 0
MBI/SAGA.GplotRelationComputerManage/SystemRelation/SystemComputerHandler.cs

@@ -69,5 +69,17 @@ namespace SAGA.GplotRelationComputerManage
             }
             Computer(useRelationTypes);
         }
+
+
+        /// <summary>
+        /// 计算所有关系信息
+        /// </summary>
+        public static void ComputerAllRelations()
+        {
+            // List<string> useRelations = new List<string>() { "ChillWaterLoop" };
+            List<string> useRelations = RelationTypeManager.GetSystemRelationTypeNames();
+            SystemComputerHandler handler1 = new SystemComputerHandler();
+            handler1.ComputerWidthCache(useRelations);
+        }
     }
 }

+ 24 - 17
MBI/SAGA.MBI/WinView/Space/SpaceManager.cs

@@ -92,7 +92,7 @@ namespace SAGA.MBI.WinView
                 return;
             double z = view.GenLevel.Elevation;
             Document doc = view.Document;
-            Plane p =Plane.CreateByNormalAndOrigin(view.ViewDirection,XYZ.Zero);
+            Plane p =Plane.CreateByNormalAndOrigin(view.ViewDirection, view.Origin);
             var sp = SketchPlane.Create(doc, p);
             foreach (var pair in separations)
             {             
@@ -133,24 +133,31 @@ namespace SAGA.MBI.WinView
                 var phase = doc.GetElement(phaseId) as Phase;
                 #region 创建新的节点
                 List<XYZ> points = new List<XYZ>();
-                var topology = doc.get_PlanTopology(level, phase);
-                foreach (PlanCircuit topologyCircuit in topology.Circuits)
-                {
-                    var point = topologyCircuit.GetPointInside();
-                    var xyz = new XYZ(point.U, point.V, level.ProjectElevation); //适当升高一些
-                    points.Add(xyz);
-                }
+                //using (SubTransaction sub=new SubTransaction(doc)) 
+                //{
+                //    var spaceSipliter=doc.GetElements<>()
+                //}
+               // PlanTopologySetting
+               // doc.Create.newsp
+                //doc.get_PlanTopology(,)
+                //var topology = doc.get_PlanTopology(level, phase);
+                //foreach (PlanCircuit topologyCircuit in topology.Circuits)
+                //{
+                //    var point = topologyCircuit.GetPointInside();
+                //    var xyz = new XYZ(point.U, point.V, level.ProjectElevation); //适当升高一些
+                //    points.Add(xyz);
+                //}
 
-                foreach (var point in points)
-                {
-                    var oldSpace = doc.GetSpaceAtPoint(point, phase);
-                    if (oldSpace == null)
-                    {
-                        doc.Create.NewSpace(level, phase, new UV(point.X, point.Y));
-                    }
-                }
+                //foreach (var point in points)
+                //{
+                //    var oldSpace = doc.GetSpaceAtPoint(point, phase);
+                //    if (oldSpace == null)
+                //    {
+                //        doc.Create.NewSpace(level, phase, new UV(point.X, point.Y));
+                //    }
+                //}
                 #endregion
-                // doc.Create.NewSpaces2()
+                // doc.Create
                 var newSpaces = doc.Create.NewSpaces2(level, phase, view);
             }