From e358beb08f5be49703009b64f058ecfbcfeefbd9 Mon Sep 17 00:00:00 2001 From: qin <a@163.com> Date: 星期六, 28 九月 2024 14:27:52 +0800 Subject: [PATCH] 测试standard2.1 --- HStation.RevitDev/RevitDataExport/Plugin/Application.cs | 70 +++++++++++++++++++++++++++++------ 1 files changed, 58 insertions(+), 12 deletions(-) diff --git a/HStation.RevitDev/RevitDataExport/Plugin/Application.cs b/HStation.RevitDev/RevitDataExport/Plugin/Application.cs index 9f69427..0f72050 100644 --- a/HStation.RevitDev/RevitDataExport/Plugin/Application.cs +++ b/HStation.RevitDev/RevitDataExport/Plugin/Application.cs @@ -28,6 +28,7 @@ public Result OnStartup(UIControlledApplication application) { m_application = application; + GlobalResource.CurrentRevitVersion = application.ControlledApplication.VersionNumber; Ribbon ribbon = new Ribbon(application); @@ -43,16 +44,21 @@ //鏄剧ず鎺у埗 RibbonPanel panel3 = ribbon.CreatePanel("鏄剧ず鎺у埗"); CreateVisibleBotton(ribbon, panel3); + CreateVisibleOtherBotton(ribbon, panel3); //鎷撴墤妫�鏌� RibbonPanel panel4 = ribbon.CreatePanel("鎷撴墤妫�鏌�"); CreateCheckBotton(ribbon, panel4); DockPaneUtil.RegistInstanceDockablePanel(application); + //璁$畻鍒嗘瀽 + RibbonPanel panel5 = ribbon.CreatePanel("璁$畻鍒嗘瀽"); + CreateAnalyBotton(ribbon, panel5); + //绯荤粺绠$悊 - RibbonPanel panel5 = ribbon.CreatePanel("绯荤粺绠$悊"); - CreateAutoClassifiedBotton(ribbon, panel4); - CreateFamilyManagerBotton(ribbon, panel5); + RibbonPanel panel6 = ribbon.CreatePanel("绯荤粺绠$悊"); + CreateAutoClassifiedBotton(ribbon, panel6); + CreateFamilyManagerBotton(ribbon, panel6); RegistEvent(); return Result.Succeeded; @@ -111,7 +117,20 @@ string imagePath = Path.Combine(GlobalResource.ImageDirectory, $"绯荤粺妫�鏌�.png"); pBtn.LargeImage = new BitmapImage(new Uri(imagePath));//32 * 32 - pBtn.ToolTip = "绯荤粺妫�鏌� "; + pBtn.ToolTip = "绯荤粺妫�鏌�"; + } + private void CreateAnalyBotton(Ribbon ribbon, RibbonPanel ribbonPanel) + { + //Check Links + string className = "HStation.RevitDev.RevitDataExport.Analy"; + string path = Assembly.GetExecutingAssembly().Location; + + PushButtonData pdata = new PushButtonData("Check", "姘村姏璁$畻", path, className); + PushButton pBtn = ribbonPanel.AddItem(pdata) as PushButton; + + string imagePath = Path.Combine(GlobalResource.ImageDirectory, $"姘村姏璁$畻.png"); + pBtn.LargeImage = new BitmapImage(new Uri(imagePath));//32 * 32 + pBtn.ToolTip = "姘村姏璁$畻"; } private void CreateVisibleBotton(Ribbon ribbon, RibbonPanel ribbonPanel) @@ -120,12 +139,26 @@ string className = "HStation.RevitDev.RevitDataExport.HideModels"; string path = Assembly.GetExecutingAssembly().Location; - PushButtonData pdata = new PushButtonData("Hide", "涓�閿樉闅�", path, className); + PushButtonData pdata = new PushButtonData("Hide", "绠$綉鏄鹃殣", path, className); PushButton pBtn = ribbonPanel.AddItem(pdata) as PushButton; string imagePath = Path.Combine(GlobalResource.ImageDirectory, $"涓�閿樉闅�.png"); pBtn.LargeImage = new BitmapImage(new Uri(imagePath));//32 * 32 - pBtn.ToolTip = "涓�閿樉闅�"; + pBtn.ToolTip = "绠$綉鏄鹃殣"; + } + + private void CreateVisibleOtherBotton(Ribbon ribbon, RibbonPanel ribbonPanel) + { + //Hide Or Display Models + string className = "HStation.RevitDev.RevitDataExport.HideOtherModels"; + string path = Assembly.GetExecutingAssembly().Location; + + PushButtonData pdata = new PushButtonData("HideOther", "鍏跺畠鏄鹃殣", path, className); + PushButton pBtn = ribbonPanel.AddItem(pdata) as PushButton; + + string imagePath = Path.Combine(GlobalResource.ImageDirectory, $"涓�閿樉闅�.png"); + pBtn.LargeImage = new BitmapImage(new Uri(imagePath));//32 * 32 + pBtn.ToolTip = "鍏跺畠鏄鹃殣"; } private void CreateExportBottons(Ribbon ribbon, RibbonPanel ribbonPanel) @@ -152,14 +185,22 @@ string className3 = "HStation.RevitDev.RevitDataExport.PipeSystem"; ribbon.CreateButton_PipeSystem(ribbonPanel, RevitType.RFT_Pipe, className3); - string className4 = "HStation.RevitDev.RevitDataExport.HeatExchangerSystem"; - ribbon.CreateButton_SystemAnalysis(ribbonPanel, RevitType.RFT_HeatExchanger, className4); + //鎹㈢儹鍣� + if (GlobalResource.ConfigSettingModel.SystemType == ConfigHelper.SystemType.All || GlobalResource.ConfigSettingModel.SystemType == ConfigHelper.SystemType.CirculatingWater) + { + string className4 = "HStation.RevitDev.RevitDataExport.HeatExchangerSystem"; + ribbon.CreateButton_SystemAnalysis(ribbonPanel, RevitType.RFT_HeatExchanger, className4); + } string className5 = "HStation.RevitDev.RevitDataExport.BlockerSystem"; ribbon.CreateButton_SystemAnalysis(ribbonPanel, RevitType.RFT_Blocker, className5); - string className6 = "HStation.RevitDev.RevitDataExport.ShowerSystem"; - ribbon.CreateButton_SystemAnalysis(ribbonPanel, RevitType.RFT_Shower, className6); + //鍠锋穻澶� + if (GlobalResource.ConfigSettingModel.SystemType == ConfigHelper.SystemType.All || GlobalResource.ConfigSettingModel.SystemType == ConfigHelper.SystemType.Spray) + { + string className6 = "HStation.RevitDev.RevitDataExport.ShowerSystem"; + ribbon.CreateButton_SystemAnalysis(ribbonPanel, RevitType.RFT_Shower, className6); + } string className7 = "HStation.RevitDev.RevitDataExport.ThreeJointSystem"; ribbon.CreateButton_SystemAnalysis(ribbonPanel, RevitType.RFT_ThreeJoint, className7); @@ -179,8 +220,12 @@ string className12 = "HStation.RevitDev.RevitDataExport.ElbowSystem"; ribbon.CreateButton_SystemAnalysis(ribbonPanel, RevitType.RFT_Elbow, className12); - string className13 = "HStation.RevitDev.RevitDataExport.FireHydrantSystem"; - ribbon.CreateButton_SystemAnalysis(ribbonPanel, RevitType.RFT_FireHydrant, className13); + //娑堢伀鏍� + if (GlobalResource.ConfigSettingModel.SystemType == ConfigHelper.SystemType.All || GlobalResource.ConfigSettingModel.SystemType == ConfigHelper.SystemType.Fire) + { + string className13 = "HStation.RevitDev.RevitDataExport.FireHydrantSystem"; + ribbon.CreateButton_SystemAnalysis(ribbonPanel, RevitType.RFT_FireHydrant, className13); + } string className14 = "HStation.RevitDev.RevitDataExport.ReducingSystem"; ribbon.CreateButton_SystemAnalysis(ribbonPanel, RevitType.RFT_Converter, className14); @@ -195,6 +240,7 @@ m_application.ControlledApplication.DocumentSaved += ControlledApplication_DocumentSaved; m_application.ControlledApplication.DocumentSavedAs += ControlledApplication_DocumentSavedAs; + } private void ControlledApplication_DocumentSavedAs(object sender, Autodesk.Revit.DB.Events.DocumentSavedAsEventArgs e) -- Gitblit v1.9.3