本文整理汇总了C#中UIControlledApplication.CreateAddInCommandBinding方法的典型用法代码示例。如果您正苦于以下问题:C# UIControlledApplication.CreateAddInCommandBinding方法的具体用法?C# UIControlledApplication.CreateAddInCommandBinding怎么用?C# UIControlledApplication.CreateAddInCommandBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIControlledApplication
的用法示例。
在下文中一共展示了UIControlledApplication.CreateAddInCommandBinding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnStartup
/// <summary>
/// Implementation of Startup for the external application.
/// </summary>
/// <param name="application">The Revit application.</param>
/// <returns>The result (typically Succeeded).</returns>
public Result OnStartup(UIControlledApplication application)
{
// Register execution override
RevitCommandId commandId = RevitCommandId.LookupCommandId("ID_EXPORT_IFC");
m_ifcCommandBinding = application.CreateAddInCommandBinding(commandId);
m_ifcCommandBinding.Executed += OnIFCExport;
return Result.Succeeded;
}
示例2: OnStartup
public Result OnStartup(UIControlledApplication uiControlledApplication)
{
try
{
//binding commands
RevitCommandId commandId = RevitCommandId.LookupCommandId("ID_MEP_DUCT_PRESSURE_LOSS_REPORT");
if (commandId != null)
{
AddInCommandBinding pressureLossCommand = uiControlledApplication.CreateAddInCommandBinding(commandId);
if (pressureLossCommand != null)
{
pressureLossCommand.CanExecute += new EventHandler<Autodesk.Revit.UI.Events.CanExecuteEventArgs>(CanDuctExecute);
pressureLossCommand.Executed += new EventHandler<Autodesk.Revit.UI.Events.ExecutedEventArgs>(DuctExecute);
}
}
commandId = RevitCommandId.LookupCommandId("ID_MEP_PIPE_PRESSURE_LOSS_REPORT");
if (commandId != null)
{
AddInCommandBinding pressureLossCommand = uiControlledApplication.CreateAddInCommandBinding(commandId);
if (pressureLossCommand != null)
{
pressureLossCommand.CanExecute += new EventHandler<Autodesk.Revit.UI.Events.CanExecuteEventArgs>(CanPipeExecute);
pressureLossCommand.Executed += new EventHandler<Autodesk.Revit.UI.Events.ExecutedEventArgs>(PipeExecute);
}
}
commandId = RevitCommandId.LookupCommandId("ID_MEP_SELECT_DUCT_PRESSURE_LOSS_REPORT");
if (commandId != null)
{
AddInCommandBinding pressureLossCommand = uiControlledApplication.CreateAddInCommandBinding(commandId);
if (pressureLossCommand != null)
{
pressureLossCommand.CanExecute += new EventHandler<Autodesk.Revit.UI.Events.CanExecuteEventArgs>(CanDuctSelectExecute);
pressureLossCommand.Executed += new EventHandler<Autodesk.Revit.UI.Events.ExecutedEventArgs>(DuctSelectExecute);
}
}
commandId = RevitCommandId.LookupCommandId("ID_MEP_SELECT_PIPE_PRESSURE_LOSS_REPORT");
if (commandId != null)
{
AddInCommandBinding pressureLossCommand = uiControlledApplication.CreateAddInCommandBinding(commandId);
if (pressureLossCommand != null)
{
pressureLossCommand.CanExecute += new EventHandler<Autodesk.Revit.UI.Events.CanExecuteEventArgs>(CanPipeSelectExecute);
pressureLossCommand.Executed += new EventHandler<Autodesk.Revit.UI.Events.ExecutedEventArgs>(PipeSelectExecute);
}
}
return Result.Succeeded;
}
catch
{
return Result.Failed;
}
}