lvxing
2024-08-01 8654386c716d8478fb8f9f62ce8cbdfb11a6155e
HStation.RevitDev/RevitDataExport/Plugin/Command.cs
@@ -1,11 +1,13 @@
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using HStation.RevitDev.Model.Enum;
using HStation.Model;
using HStation.RevitDev.Model.ModelEnum;
using HStation.RevitDev.RevitDataExport.Forms;
using HStation.RevitDev.RevitDataExport.Utility;
using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
namespace HStation.RevitDev.RevitDataExport
@@ -26,12 +28,28 @@
    }
    /// <summary>
    /// 导出模型
    /// </summary>
    [Transaction(TransactionMode.Manual)]
    public class ExportModels : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            var doc = commandData.Application.ActiveUIDocument.Document;
            CacheUtil.SaveCache(commandData.Application.ActiveUIDocument.Document);
            TaskDialog.Show("提示", "导出完成!");
            return Result.Succeeded;
        }
    }
    /// <summary>
    /// 水泵
    /// </summary>
    [Transaction(TransactionMode.Manual)]
    public class PumpSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_Pump;
        RevitType m_type = RevitType.RFT_Pump;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
@@ -46,7 +64,7 @@
    [Transaction(TransactionMode.Manual)]
    public class PipeSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_Pipe;
        RevitType m_type = RevitType.RFT_Pipe;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            Common.GlobalResource.CurrentAddinId = commandData.Application.ActiveAddInId;
@@ -62,7 +80,7 @@
    [Transaction(TransactionMode.Manual)]
    public class ValveSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_Valve;
        RevitType m_type = RevitType.RFT_Valve;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
@@ -77,7 +95,7 @@
    [Transaction(TransactionMode.Manual)]
    public class HeatExchangerSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_HeatExchanger;
        RevitType m_type = RevitType.RFT_HeatExchanger;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
@@ -92,7 +110,7 @@
    [Transaction(TransactionMode.Manual)]
    public class BlockerSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_Blocker;
        RevitType m_type = RevitType.RFT_Blocker;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
@@ -107,7 +125,7 @@
    [Transaction(TransactionMode.Manual)]
    public class ShowerSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_Shower;
        RevitType m_type = RevitType.RFT_Shower;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
@@ -122,7 +140,7 @@
    [Transaction(TransactionMode.Manual)]
    public class ThreeJointSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_ThreeJoint;
        RevitType m_type = RevitType.RFT_ThreeJoint;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
@@ -137,7 +155,7 @@
    [Transaction(TransactionMode.Manual)]
    public class FourJointSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_FourJoint;
        RevitType m_type = RevitType.RFT_FourJoint;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
@@ -152,7 +170,7 @@
    [Transaction(TransactionMode.Manual)]
    public class WaterMeterSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_WaterMeter;
        RevitType m_type = RevitType.RFT_WaterMeter;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
@@ -167,7 +185,7 @@
    [Transaction(TransactionMode.Manual)]
    public class WaterPoolSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_WaterPool;
        RevitType m_type = RevitType.RFT_WaterPool;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
@@ -182,7 +200,7 @@
    [Transaction(TransactionMode.Manual)]
    public class WaterBoxSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_WaterBox;
        RevitType m_type = RevitType.RFT_WaterBox;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
@@ -197,7 +215,7 @@
    [Transaction(TransactionMode.Manual)]
    public class ElbowSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_Elbow;
        RevitType m_type = RevitType.RFT_Elbow;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
@@ -212,7 +230,22 @@
    [Transaction(TransactionMode.Manual)]
    public class FireHydrantSystem : IExternalCommand
    {
        RevitFamilyType m_type = RevitFamilyType.RFT_FireHydrant;
        RevitType m_type = RevitType.RFT_FireHydrant;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);
            DockablePaneUtils.ShowDockablePanel(commandData, m_type);
            return Result.Succeeded;
        }
    }
    /// <summary>
    /// 变径
    /// </summary>
    [Transaction(TransactionMode.Manual)]
    public class ReducingSystem : IExternalCommand
    {
        RevitType m_type = RevitType.RFT_Reducing;
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            DocumentUtil.RegistDocumentEvent(commandData.Application.Application);