当前位置: 首页>>代码示例>>C#>>正文


C# UIControlledApplication.CreateAddInCommandBinding方法代码示例

本文整理汇总了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;
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:14,代码来源:IFCCommandOverrideApplication.cs

示例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;
             }
        }
开发者ID:jeremytammik,项目名称:UserMepCalculation,代码行数:60,代码来源:PressureLossReportEntry.cs


注:本文中的UIControlledApplication.CreateAddInCommandBinding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。