添加项目文件。
This commit is contained in:
36
CDMUtil/UIRibbon.cs
Normal file
36
CDMUtil/UIRibbon.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Autodesk.Revit.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CDM.Interop.Revit
|
||||
{
|
||||
class UIRibbon : IExternalApplication
|
||||
{
|
||||
// 程序集路径
|
||||
static string AddInPath = typeof(UIRibbon).Assembly.Location;
|
||||
// 按钮图标目录
|
||||
//static string ButtonIconsFolder = Path.GetDirectoryName(AddInPath);
|
||||
// uiApplication
|
||||
//static UIApplication uiApplication = null;
|
||||
|
||||
public Result OnShutdown(UIControlledApplication application)
|
||||
{
|
||||
return Result.Succeeded;
|
||||
}
|
||||
|
||||
public Result OnStartup(UIControlledApplication application)
|
||||
{
|
||||
RibbonPanel ribbonPanel = application.CreateRibbonPanel("CDM-Revit交换");
|
||||
PushButtonData cdmtorevit = new PushButtonData("导入CDM集", "导入CDM集", AddInPath, "CDM.Interop.Revit.CmdCDMToRevit");
|
||||
PushButton cdmtorevitData = ribbonPanel.AddItem(cdmtorevit) as PushButton;
|
||||
PushButtonData revittocdm = new PushButtonData("导出CDM集", "导出CDM集", AddInPath, "CDM.Interop.Revit.CmdRevitToCDM");
|
||||
PushButton revittocdmData = ribbonPanel.AddItem(revittocdm) as PushButton;
|
||||
|
||||
return Result.Succeeded;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user