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


C# Autodesk.CreateRibbonPanel方法代码示例

本文整理汇总了C#中Autodesk.CreateRibbonPanel方法的典型用法代码示例。如果您正苦于以下问题:C# Autodesk.CreateRibbonPanel方法的具体用法?C# Autodesk.CreateRibbonPanel怎么用?C# Autodesk.CreateRibbonPanel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Autodesk的用法示例。


在下文中一共展示了Autodesk.CreateRibbonPanel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnStartup

        public Autodesk.Revit.UI.Result OnStartup(Autodesk.Revit.UI.UIControlledApplication application)
        {
            RibbonPanel ribbonPanel = application.CreateRibbonPanel("NewRibbonPanel");
            //PushButtonData pbd = new PushButtonData("name", "text", @"C:\Users\einst\Desktop\Danqing\GitRepo\RevitLab\2.2 HelloWorld\bin\Debug\2.2 HelloWorld.dll", "HelloWorld");
            PushButton pushBotton = ribbonPanel.AddItem(new PushButtonData("HelloWorld", "HelloWorld", @"C:\Users\einst\AppData\Roaming\Autodesk\Revit\Addins\2016\HelloWorld.dll", "_2._2_HelloWorld.HelloWorld")) as PushButton;

            Uri urlImage = new Uri(@"C:\Users\einst\Desktop\Danqing\UrlImage\01.jpg");
            BitmapImage largeImage = new BitmapImage(urlImage);
            pushBotton.LargeImage = largeImage;

            return Result.Succeeded;
        }
开发者ID:DanqingYANG,项目名称:RevitLab,代码行数:12,代码来源:CsAddPanel.cs

示例2: OnStartup

        /// <summary>
        /// Implement this method to implement the external application which should be called when 
        /// Revit starts before a file or default template is actually loaded.
        /// </summary>
        /// <param name="application">An object that is passed to the external application 
        /// which contains the controlled application.</param>
        /// <returns>Return the status of the external application. 
        /// A result of Succeeded means that the external application successfully started. 
        /// 
        /// Cancelled can be used to signify that the user cancelled the external operation at 
        /// some point.
        /// 
        /// If Failed is returned then Revit should inform the user that the external application 
        /// failed to load and the release the internal reference.
        /// 
        /// This method also adds a ribbon panel and button to launch an IExternalCommand
        /// defined in UICommand.cs.  It also registers a new IPerformanceAdviserRule-implementing class
        /// (m_FlippedDoorApiRule) with PerformanceAdviser.
        /// 
        /// </returns>
        public Autodesk.Revit.UI.Result OnStartup(Autodesk.Revit.UI.UIControlledApplication application)
        {
            #region Add command button
               RibbonPanel rp = application.CreateRibbonPanel("PerformanceAdviserControl");
               string currentAssemby = System.Reflection.Assembly.GetAssembly(this.GetType()).Location;
               PushButton pb = rp.AddItem(new PushButtonData("Performance Adviser", "Performance Adviser", currentAssemby, "PerformanceAdviserControl.UICommand")) as PushButton;
               Uri uriImage = new Uri(System.IO.Path.GetDirectoryName(currentAssemby) + "\\Button32.png");
               BitmapImage largeImage = new BitmapImage(uriImage);
               pb.LargeImage = largeImage;
               #endregion

               #region Create and register new API rule (FlippedDoorCheck)
               m_FlippedDoorApiRule = new FlippedDoorCheck();
               Autodesk.Revit.DB.PerformanceAdviser.GetPerformanceAdviser().AddRule(m_FlippedDoorApiRule.getRuleId(), m_FlippedDoorApiRule);
               #endregion

               return Autodesk.Revit.UI.Result.Succeeded;
        }
开发者ID:AMEE,项目名称:revit,代码行数:38,代码来源:Application.cs


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