| | |
| | | public Result OnStartup(UIControlledApplication application)
|
| | | {
|
| | | m_application = application;
|
| | | |
| | | GlobalResource.CurrentRevitVersion = application.ControlledApplication.VersionNumber;
|
| | | Ribbon ribbon = new Ribbon(application);
|
| | |
|
| | |
| | | //显示控制
|
| | | 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;
|
| | |
| | |
|
| | | 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)
|
| | |
| | | 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)
|
| | |
| | | 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);
|
| | |
| | | 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);
|
| | |
| | |
|
| | | m_application.ControlledApplication.DocumentSaved += ControlledApplication_DocumentSaved;
|
| | | m_application.ControlledApplication.DocumentSavedAs += ControlledApplication_DocumentSavedAs;
|
| | | |
| | | }
|
| | |
|
| | | private void ControlledApplication_DocumentSavedAs(object sender, Autodesk.Revit.DB.Events.DocumentSavedAsEventArgs e)
|