Message 1 of 3
Not applicable
04-10-2013
01:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
//创建Panle
private void CreateRibbonPanel(UIControlledApplication application)
{
string tabName = "测绘院工具集";
string panelName = "测绘院";
string panelHelperName = "帮助信息";
application.CreateRibbonTab(tabName);
#region 孔洞插件
RibbonPanel panelHole = application.CreateRibbonPanel(tabName, panelName);
panelHole.Title = "孔洞插件";
//自动开洞
PushButtonData btnData1 = new PushButtonData(Properties.Resources.AutoHoleButtonName, Properties.Resources.AutoHoleButtonTitle, AddInPath, "NBGisRevit.NBGisOpeningInWallCommand");
PushButton button1 = panelHole.AddItem(btnData1) as PushButton;
button1.ToolTip = "自动开洞";
button1.LongDescription = "自动开洞";
button1.LargeImage = CommFunction.GetEmbeddedImage("NBGisRevit.Resources.Icons.qzdkd.png", ImageType.Png);
#endregion
}
[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
public class NBGisOpeningMonitorCommand : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
try
{
//How to get the PushButton i clicked here?
return Result.Succeeded;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return Result.Failed;
}
}
}About is the code , i want to get the button i clicked in the Excute Function,because i want to change the text of the button,so how can i do this?
Solved! Go to Solution.