|
@@ -0,0 +1,173 @@
|
|
|
+using DrawData;
|
|
|
+using System;
|
|
|
+using System.Linq;
|
|
|
+using Autodesk.Revit.Attributes;
|
|
|
+using Autodesk.Revit.DB;
|
|
|
+using Autodesk.Revit.UI;
|
|
|
+using SAGA.GplotDrawData;
|
|
|
+using SAGA.GplotRelationComputerManage.PumpEnd;
|
|
|
+using SAGA.RevitUtils;
|
|
|
+using SAGA.RevitUtils.Extends;
|
|
|
+using MainWindow = SAGA.GplotDrawData.MainWindow;
|
|
|
+using SAGA.GplotRelationComputerManage;
|
|
|
+
|
|
|
+namespace SAGA.GplotManage
|
|
|
+{
|
|
|
+ /// <summary>
|
|
|
+ /// 供水管 回水管拓扑图
|
|
|
+ /// </summary>
|
|
|
+ [Transaction(TransactionMode.Manual)]
|
|
|
+ [Regeneration(RegenerationOption.Manual)]
|
|
|
+ public class SupplyHydronicTopoGraph : ExternalCommand
|
|
|
+ {
|
|
|
+ public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
|
+ {
|
|
|
+ base.Execute(commandData, ref message, elements);
|
|
|
+ using (Transaction trans = new Transaction(ExternalDataWrapper.Current.Doc, "读取风管系统"))
|
|
|
+ {
|
|
|
+ trans.Start();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ DuctTerminalBll.DrawPipePlane();
|
|
|
+
|
|
|
+ trans.Commit();
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ trans.RollBack();
|
|
|
+ MessageShow.Show(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Result.Succeeded;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 配电关系图--配电柜与配电柜
|
|
|
+ /// </summary>
|
|
|
+ [Transaction(TransactionMode.Manual)]
|
|
|
+ [Regeneration(RegenerationOption.Manual)]
|
|
|
+ public class DistributionRelationshipCommand : ExternalCommand
|
|
|
+ {
|
|
|
+ public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
|
+ {
|
|
|
+ #region 核心
|
|
|
+ try
|
|
|
+ {
|
|
|
+ DistributionRelationshipHandler handler = new DistributionRelationshipHandler();
|
|
|
+ var re = handler.GetViewData(new PowerComputerContext());
|
|
|
+ if (re[0].Childrens.Any())
|
|
|
+ {
|
|
|
+ WinEquipmentRelation_Web window =
|
|
|
+ new WinEquipmentRelation_Web(re[0].Childrens, re[1].Childrens);
|
|
|
+ window.Title = "配电拓扑图:配电柜--配电柜";
|
|
|
+ window.Show();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ MessageShow.Show(ex);
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+ return Result.Succeeded;
|
|
|
+ }
|
|
|
+ public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 配电关系图--配电柜与配电设备
|
|
|
+ /// </summary>
|
|
|
+ [Transaction(TransactionMode.Manual)]
|
|
|
+ [Regeneration(RegenerationOption.Manual)]
|
|
|
+ public class DistributionEqRelationshipCommand : ExternalCommand
|
|
|
+ {
|
|
|
+ public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
|
+ {
|
|
|
+ #region 核心处理
|
|
|
+ EquipPowerRelationshipHandler handler = new EquipPowerRelationshipHandler();
|
|
|
+ var re = handler.GetViewData(new PowerComputerContext());
|
|
|
+ if (re[0].Childrens.Any())
|
|
|
+ {
|
|
|
+ WinEquipmentRelation_Web window =
|
|
|
+ new WinEquipmentRelation_Web(re[0].Childrens, re[1].Childrens);
|
|
|
+ window.Title = "配电拓扑图:配电柜--末端";
|
|
|
+ window.Show();
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+ return Result.Succeeded;
|
|
|
+ }
|
|
|
+ public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 对象受控关系
|
|
|
+ /// </summary>
|
|
|
+ [Transaction(TransactionMode.Manual)]
|
|
|
+ [Regeneration(RegenerationOption.Manual)]
|
|
|
+ public class BelongEqRelationshipCommand : ExternalCommand
|
|
|
+ {
|
|
|
+ public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
|
+ {
|
|
|
+
|
|
|
+ #region 核心处理
|
|
|
+ ObjectControlRelationshipHandler handler = new ObjectControlRelationshipHandler();
|
|
|
+ var re = handler.GetViewData(new PowerComputerContext());
|
|
|
+ if (re[0].Childrens.Any())
|
|
|
+ {
|
|
|
+ WinControlRelation_Web window =
|
|
|
+ new WinControlRelation_Web(re[0].Childrens, re[1].Childrens);
|
|
|
+ window.Title = "对象受控关系图";
|
|
|
+ window.Show();
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return Result.Succeeded;
|
|
|
+ }
|
|
|
+
|
|
|
+ public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 空间关系查看
|
|
|
+ /// </summary>
|
|
|
+ [Transaction(TransactionMode.Manual)]
|
|
|
+ [Regeneration(RegenerationOption.Manual)]
|
|
|
+ public class SpaceViewCommand : ExternalCommand
|
|
|
+ {
|
|
|
+ public SpaceViewCommand()
|
|
|
+ {
|
|
|
+ IsShowNoDocument = true;
|
|
|
+ }
|
|
|
+ public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ var win = new WinDrawSpace();
|
|
|
+ win.ShowDialog();
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+
|
|
|
+ MessageShow.Show(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ return Result.Succeeded;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|