zhangyk-c
2024-07-11 9ca59ac2d37530208538a05a704b5ea712cab7db
HStation.RevitDev/RevitDataExport/Plugin/Command.cs
@@ -2,9 +2,11 @@
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using HStation.RevitDev.RevitDataExport.Forms;
using Spire.AI.Api;
using System;
using System.Diagnostics;
using System.Drawing.Drawing2D;
using System.Windows.Controls;
using System.Windows.Forms;
namespace HStation.RevitDev.RevitDataExport
@@ -21,6 +23,12 @@
            var revitHandle = Process.GetCurrentProcess().MainWindowHandle;
            form.Show(new WindowHandle(revitHandle));
            //测试代码
            UIApplication uiapp = commandData.Application;
            Guid guid = new Guid(Common.GlobalResource.Guid_FamilyPanel);
            DockablePaneId paneId = new DockablePaneId(guid);
            DockablePane pane = uiapp.GetDockablePane(paneId);
            pane.Hide();
            return Result.Succeeded;
        }
@@ -32,10 +40,16 @@
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            TaskDialog.Show("提示","泵系统分析命令调用成功!");
            UIApplication uiapp = commandData.Application;
            Wpf_FamilyPanel page = new Wpf_FamilyPanel();
            Guid guid = Guid.Empty;
            guid = new Guid(Common.GlobalResource.Guid_FamilyPanel);
            DockablePaneId paneId = new DockablePaneId(guid);
            DockablePane pane = uiapp.GetDockablePane(paneId);
            pane.Show();
            return Result.Succeeded;
        }
    }
    public class WindowHandle : IWin32Window