public Result OnStartup(UIControlledApplication application)
        {
            RibbonPanel panel =
                application.CreateRibbonPanel("EntitlementAPI");

            ContextualHelp contextHelp = new ContextualHelp(
                ContextualHelpType.Url, "http://www.autodesk.com/developapps");

            PushButtonData button = new PushButtonData(
                "EntitlementAPI",
                "EntitlementAPI",
                typeof(ExtApplication).Assembly.Location,
                "EntitlementAPIRevit.Commands");
            button.Image = button.LargeImage =
              getBitmap("appicon2.png");
            button.ToolTip = "This function lets you to check the Entitlement of the user";
            button.LongDescription = "Using this functionality you can create simple copy protection mechanism ";
            button.SetContextualHelp(contextHelp);

            panel.AddItem(button);

            return Result.Succeeded;
        }
Beispiel #2
0
        public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application)
        {
            try
            {
                RibbonPanel    panel = application.CreateRibbonPanel("EnTools");
                PushButtonData list  = new PushButtonData("Swap", "Swap", AddInPath, "Entools.Model.Entools")
                {
                    ToolTip = "Swap"
                };
                string path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

                ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.ChmFile, path + @"\Help.htm"); // hard coding for simplicity.
                list.SetContextualHelp(contextHelp);
                PushButton billButton = panel.AddItem(list) as PushButton;
                billButton.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "icons\\iconlarge.png"), UriKind.Absolute));
                billButton.Image      = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "icons\\iconsmall.png"), UriKind.Absolute));

                return(Autodesk.Revit.UI.Result.Succeeded);
            }
            catch (Exception ex)
            {
                TaskDialog.Show("EnToolsLt Sample", ex.ToString());
                return(Autodesk.Revit.UI.Result.Failed);
            }
        }
Beispiel #3
0
        public Result OnStartup(UIControlledApplication application)
        {
            try
            {
                thisApp    = this;
                mainWindow = null;

                try { application.CreateRibbonTab(tabName); }
                catch { }

                RibbonPanel panel           = application.CreateRibbonPanel(tabName, "BCF");
                string      currentAssembly = System.Reflection.Assembly.GetAssembly(this.GetType()).Location;

                BitmapSource sheetImage = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(Resources.walker.GetHbitmap(), IntPtr.Zero, System.Windows.Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());

                PushButton sheetButton = panel.AddItem(new PushButtonData("Smart BCF", "Smart BCF", currentAssembly, "HOK.SmartBCF.AddIn.Command")) as PushButton;
                sheetButton.LargeImage            = sheetImage;
                sheetButton.AvailabilityClassName = "HOK.SmartBCF.AddIn.Availability";

                string instructionFile = @"V:\RVT-Data\HOK Program\Documentation\SmartBCF_Instruction.pdf";
                if (File.Exists(instructionFile))
                {
                    ContextualHelp contextualHelp = new ContextualHelp(ContextualHelpType.Url, instructionFile);
                    sheetButton.SetContextualHelp(contextualHelp);
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }

            return(Result.Succeeded);
        }
Beispiel #4
0
        public Result OnStartup(UIControlledApplication a)
        {
            try
            {
                Assembly exe     = Assembly.GetExecutingAssembly();
                string   dllpath = exe.Location;

                string         helpPath = Path.Combine(Path.GetDirectoryName(dllpath), "TimeStampHelp.html");
                ContextualHelp help     = new ContextualHelp(ContextualHelpType.ChmFile, helpPath);

                //Create the panel for the TimeStamp
                RibbonPanel TimeStampPanel = a.CreateRibbonPanel("Time Stamper");

                //Add FSL Button
                PushButtonData timeStampButton = new PushButtonData("TimeStampButton", "Stamp\r\nModel", dllpath, "TimeStamp.ModelTimeStamp");
                timeStampButton.ToolTip    = "Add Date and File information on every Revit model object.";
                timeStampButton.LargeImage = Tools.GetEmbeddedImage("TimeStamp.Resources.TimeStamp_Large.png");
                timeStampButton.Image      = Tools.GetEmbeddedImage("TimeStamp.Resources.TimeStamp_Small.png");
                timeStampButton.SetContextualHelp(help);
                TimeStampPanel.AddItem(timeStampButton);

                return(Result.Succeeded);
            }
            catch
            {
                // Return Failure
                return(Result.Failed);
            }
        }
Beispiel #5
0
        static void AddRibbonPanel(UIControlledApplication application)
        {
            // Create a custom ribbon panel
            String tabName   = "Archilizer";
            String panelName = "Miscellaneous";

            try
            {
                application.CreateRibbonTab(tabName);
            }
            catch (Exception)
            {
            }

            RibbonPanel ribbonPanel = (RibbonPanel)TheInternalDoingPart(application, tabName, panelName);

            // Get dll assembly path
            string thisAssemblyPath = Assembly.GetExecutingAssembly().Location;

            assembly = Assembly.GetExecutingAssembly();

            ContextualHelp ch = new ContextualHelp(ContextualHelpType.Url, @helpFile);

            CreatePushButton(ribbonPanel, String.Format("Warning" + Environment.NewLine + "Chart"), thisAssemblyPath, "WC.CommandWarningChart",
                             String.Format("Displays a Pie Chart representing Project Warnings.{0}{0}v1.0.1", Environment.NewLine), "WC.Resources.icon_Warchart.png", ch);
        }
Beispiel #6
0
        /// <summary>
        /// Add ribbon panel
        /// </summary>
        /// <param name="application"></param>
        private void AddRibbonPanel(UIControlledApplication application)
        {
            assembly = Assembly.GetExecutingAssembly();
            // Create a custom ribbon panel or use the existing one
            String tabName   = "Archilizer";
            String panelName = "Family Document";

            try
            {
                application.CreateRibbonTab(tabName);
            }
            catch (Autodesk.Revit.Exceptions.ArgumentException) { }

            List <RibbonPanel> panels         = application.GetRibbonPanels();
            RibbonPanel        rvtRibbonPanel = null;

            // Pick the correct panel
            if (panels.FirstOrDefault(x => x.Name.Equals(panelName, StringComparison.OrdinalIgnoreCase)) == null)
            {
                rvtRibbonPanel = application.CreateRibbonPanel(tabName, panelName);
            }
            else
            {
                rvtRibbonPanel = panels.FirstOrDefault(x => x.Name.Equals(panelName, StringComparison.OrdinalIgnoreCase)) as RibbonPanel;
            }
            //PulldownButtonData data = new PulldownButtonData("Options", "Family Editor" + Environment.NewLine + "Interface");


            // Get dll assembly path
            string         thisAssemblyPath = Assembly.GetExecutingAssembly().Location;
            ContextualHelp ch = new ContextualHelp(ContextualHelpType.Url, @helpFile);

            CreatePushButton(rvtRibbonPanel, String.Format("Family Editor" + Environment.NewLine + "Interface"), thisAssemblyPath, "FamilyEditorInterface.Command",
                             Message, "FamilyEditorInterface.Resources.icon_Families.png", ch);
        }
Beispiel #7
0
        /// <summary>
        /// Add ribbon panel 
        /// </summary>
        /// <param name="a"></param>
        private void AddRibbonPanel(UIControlledApplication a)
        {
            Autodesk.Revit.UI.RibbonPanel rvtRibbonPanel = a.CreateRibbonPanel("Archilizer FEI");
            PulldownButtonData data = new PulldownButtonData("Options", "Family Editor" + Environment.NewLine + "Interface");

            BitmapSource img32 = new BitmapImage (new Uri (@largeIcon));
            BitmapSource img16 = new BitmapImage (new Uri (@smallIcon));

            //RibbonItem item = rvtRibbonPanel.AddItem(data);
            //PushButton optionsBtn = item as PushButton;
            //ContextualHelp ch = new ContextualHelp(ContextualHelpType.Url, "file:///C:/Users/adicted/AppData/Roaming/Autodesk/Revit/Addins/2015/Family Editor Interface _ AutoCAD _ Autodesk App Store.html");
            ContextualHelp ch = new ContextualHelp(ContextualHelpType.Url, @helpFile);
            
            PushButton familyEI = rvtRibbonPanel.AddItem(new PushButtonData("Family Editor", "Family Editor" + Environment.NewLine +  "Interface", path,
                "FamilyEditorInterface.Command")) as PushButton;

            familyEI.Image = img16;
            familyEI.LargeImage = img32;
            familyEI.ToolTip = Message;
            familyEI.SetContextualHelp(ch);
            //optionsBtn.AddPushButton(new PushButtonData("Automatic Dimensions", "AutoDim", path,
            //    "AutomaticDimensions.AutoDim"));
            //optionsBtn.AddPushButton(new PushButtonData("CAD|BIM", "CAD|BIM", path,
            //    "BimpowAddIn.BimToCad"));
        }
Beispiel #8
0
        /// <summary>
        /// On Start Up
        /// </summary>
        /// <param name="application"></param>
        /// <returns></returns>
        public Result OnStartup(UIControlledApplication application)
        {
            try
            {
                thisApp    = this;
                mainWindow = null;
                //Create a tab named HOK - Beta
                try { application.CreateRibbonTab(tabName); }
                catch { }

                //ribbon panel named BCF
                RibbonPanel panel           = application.CreateRibbonPanel(tabName, "BCF");
                string      currentAssembly = System.Reflection.Assembly.GetAssembly(this.GetType()).Location;
                //button image from resources
                BitmapSource sheetImage = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(Resources.walker.GetHbitmap(), IntPtr.Zero, System.Windows.Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());

                PushButton sheetButton = panel.AddItem(new PushButtonData("Smart BCF", "Smart BCF", currentAssembly, "HOK.SmartBCF.AddIn.Command")) as PushButton;
                sheetButton.LargeImage            = sheetImage;
                sheetButton.AvailabilityClassName = "HOK.SmartBCF.AddIn.Availability";

                //instruction file to open by F1 key
                string instructionFile = @"https://github.com/HOKGroup/SmartBCF";
                if (File.Exists(instructionFile))
                {
                    ContextualHelp contextualHelp = new ContextualHelp(ContextualHelpType.Url, instructionFile);
                    sheetButton.SetContextualHelp(contextualHelp);
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }

            return(Result.Succeeded);
        }
Beispiel #9
0
        public static void CreateIcons(RibbonPanel bim42Panel)
        {
            //Retrive dll path
            string DllPath = Assembly.GetExecutingAssembly().Location;

            ContextualHelp helpFile = CreateContextualHelp("BIM42Help");

            //Add RoomsFinishes Button
            string         ButtonText       = Tools.LangResMan.GetString("roomFinishes_button_name", Tools.Cult);
            PushButtonData FinishButtonData = new PushButtonData("RoomsFiButton", ButtonText, DllPath, "RoomFinishes.RoomsFinishes.RoomsFinishes");

            FinishButtonData.ToolTip    = Tools.LangResMan.GetString("roomFinishes_toolTip", Tools.Cult);
            FinishButtonData.LargeImage = RetriveImage("RoomFinishes.Resources.RoomFinishLarge.png");
            FinishButtonData.Image      = RetriveImage("RoomFinishes.Resources.RoomFinishSmall.png");
            FinishButtonData.SetContextualHelp(helpFile);
            //bim42Panel.AddItem(FinishButtonData);

            //Add FloorFinishes Button
            string         floorButtonText = Tools.LangResMan.GetString("floorFinishes_ribbon_panel_name", Tools.Cult);
            PushButtonData floorButtonData = new PushButtonData("FloorFiButton", floorButtonText, DllPath, "RoomFinishes.RoomsFinishes.FloorFinishes");

            floorButtonData.ToolTip    = Tools.LangResMan.GetString("floorFinishes_toolTip", Tools.Cult);
            floorButtonData.LargeImage = RetriveImage("RoomFinishes.Resources.FloorFinishesLarge.png");
            floorButtonData.Image      = RetriveImage("RoomFinishes.Resources.FloorFinishesSmall.png");
            floorButtonData.SetContextualHelp(helpFile);

            //Group RoomsFinishes button
            SplitButtonData sbRoomData = new SplitButtonData("splitButton2", "BIM 42");
            SplitButton     sbRoom     = bim42Panel.AddItem(sbRoomData) as SplitButton;

            sbRoom.AddPushButton(FinishButtonData);
            sbRoom.AddPushButton(floorButtonData);
        }
Beispiel #10
0
        //Add ribbon panel
        private void AddRibbonPanel(UIControlledApplication application)
        {
            assembly        = Assembly.GetExecutingAssembly();
            assemblyVersion = $"v{assembly.GetName().Version.ToString()}";
            assemblyVersion = assemblyVersion.Substring(0, assemblyVersion.Length - 2);
            string thisAssemblyPath = assembly.Location;   // Get dll assembly path

            // Create a custom ribbon panel or use the existing one
            String tabName   = "Archilizer";
            String panelName = "Family Document";

            try
            {
                application.CreateRibbonTab(tabName);
            }
            catch (Autodesk.Revit.Exceptions.ArgumentException) { }

            RibbonPanel    rvtRibbonPanel = PickPanel(application, panelName, tabName);
            ContextualHelp ch             = new ContextualHelp(ContextualHelpType.Url, @helpFile);

            var buttons = GetStackButtons(ch); //Create the stack buttons

            CreatePushButton(rvtRibbonPanel, String.Format("Family Editor" + Environment.NewLine + "Interface"), thisAssemblyPath, "FamilyEditorInterface.Command", Message, assemblyVersion, "FamilyEditorInterface.Resources.icon_Families.png", ch);
            CreateStackButtons(tabName, panelName, rvtRibbonPanel, buttons, thisAssemblyPath);
        }
Beispiel #11
0
        private void AddRibbonPanel(UIControlledApplication app)
        {
            RibbonPanel panel = app.CreateRibbonPanel("By Ehab Bkheit ");

            PushButtonData pbd_PL      = new PushButtonData("Placing Light ", "Placing Light", assyPath, "PlacingLight.Command");
            PushButton     pb_PLbutton = panel.AddItem(pbd_PL) as PushButton;


            // Reflection of path to image
            var globePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "PLicon.png");
            Uri uriImage  = new Uri(globePath);
            // Apply image to bitmap
            BitmapImage largeImage = new BitmapImage(uriImage);

            // Apply image to button
            pb_PLbutton.LargeImage = largeImage;

            pb_PLbutton.ToolTip         = "Distribute hosted light family on false ceiling";
            pb_PLbutton.LongDescription =
                " Select hosted light fixture in false ceiling \npick two-point  to specify a rectangular Room on the screen \nEnter number of Row Light then enter number of Column Light\nstandard light distrubtion will be placed on ceiling x-2x-x ";

            //ContextualHe/lp contextHelp = new ContextualHelp(ContextualHelpType.ChmFile, dir + "/Resources/STFExporter Help.htm");
            ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.Url, "https://github.com/ehabElec");

            pb_PLbutton.SetContextualHelp(contextHelp);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="panel">Панель, на которой следует
        /// разместить добавляемую кнопку.</param>
        /// <param name="cmd_name">Имя команды</param>
        /// <param name="cmd_text">Ключ ресурса, содержащего
        /// отображаемое имя команды.
        /// </param>
        /// <param name="cmd_tooltip">Ключ ресурса, содержащего
        /// краткое описание команды.
        /// </param>
        /// <param name="long_description">Ключ ресурса,
        /// содержащего развёрнутое описание команды.</param>
        /// <param name="large_img_name">Ключ ресурса,
        /// содержащего изображение, располагающееся на новой
        /// кнопке.</param>
        /// <param name="tooltip_img_name">Ключ ресурса,
        /// содержащего изображение, отображаемое в развёрнутом
        /// описании команды.</param>
        /// <param name="cmd_type">Тип, определяющий команду.
        /// </param>
        /// <param name="aviability_type">Тип, выполняющий
        /// проверку доступности команды.</param>
        /// <param name="help">Настройки связи создаваемой
        /// кнопки с конкретным разделом справочной системы.
        /// </param>
        void AddRibbonItem(RibbonPanel panel,
                           string cmd_name, string cmd_text,
                           string cmd_tooltip, string long_description,
                           string large_img_name,
                           string tooltip_img_name,
                           Type cmd_type, Type aviability_type,
                           ContextualHelp help)
        {
            string this_assembly_path = Assembly
                                        .GetExecutingAssembly().Location;

            ResourceManager res_mng = new ResourceManager(
                typeof(Resources));

            string text = res_mng.GetString(cmd_text);

            PushButtonData button_data = new PushButtonData(
                cmd_name, text,
                this_assembly_path, cmd_type.FullName);

            button_data.AvailabilityClassName =
                aviability_type.FullName;

            PushButton push_button = panel.AddItem(
                button_data) as PushButton;

            string tooltip = res_mng.GetString(cmd_tooltip);

            push_button.ToolTip = tooltip;

            Bitmap large_image = (Bitmap)res_mng.GetObject(
                large_img_name);

            BitmapSource large_bitmap_src = Imaging
                                            .CreateBitmapSourceFromHBitmap(
                large_image.GetHbitmap(), IntPtr.Zero,
                Int32Rect.Empty, BitmapSizeOptions
                .FromEmptyOptions());

            push_button.LargeImage = large_bitmap_src;

            Bitmap tooltip_image = (Bitmap)res_mng.GetObject(
                tooltip_img_name);

            BitmapSource tooltip_bitmap_src = Imaging
                                              .CreateBitmapSourceFromHBitmap(
                tooltip_image.GetHbitmap(), IntPtr.Zero,
                Int32Rect.Empty, BitmapSizeOptions
                .FromEmptyOptions());

            push_button.ToolTipImage = tooltip_bitmap_src;

            push_button.LongDescription = res_mng.GetString(
                long_description);

            push_button.SetContextualHelp(help);

            res_mng.ReleaseAllResources();
        }
 public void setHelp(ContextualHelp ch)
 {
     help = ch;
     if (help == null)
     {
         Logger.trace("************************************* help is null *************************");
     }
 }
Beispiel #14
0
        public Result OnStartup(UIControlledApplication application)
        {
            //IL_000f: Unknown result type (might be due to invalid IL or missing references)
            //IL_001f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0026: Unknown result type (might be due to invalid IL or missing references)
            //IL_002b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0032: Unknown result type (might be due to invalid IL or missing references)
            //IL_0037: Unknown result type (might be due to invalid IL or missing references)
            //IL_0038: Unknown result type (might be due to invalid IL or missing references)
            //IL_004d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0052: Unknown result type (might be due to invalid IL or missing references)
            //IL_0057: Expected O, but got Unknown
            //IL_005c: Unknown result type (might be due to invalid IL or missing references)
            //IL_005d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0069: Unknown result type (might be due to invalid IL or missing references)
            //IL_007a: Unknown result type (might be due to invalid IL or missing references)
            //IL_008b: Unknown result type (might be due to invalid IL or missing references)
            //IL_008c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0093: Unknown result type (might be due to invalid IL or missing references)
            //IL_009a: Unknown result type (might be due to invalid IL or missing references)
            //IL_00af: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b9: Expected O, but got Unknown
            //IL_00be: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
            //IL_00df: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f3: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
            this.m_MyForm = null;
            string text = "Hot Gear";

            try
            {
                application.CreateRibbonTab(text);
            }
            catch
            {
            }
            RibbonPanel    val            = application.CreateRibbonPanel(text, "Parameter Explorer");
            ContextualHelp contextualHelp = new ContextualHelp(2, "https://hotgearproject.wordpress.com/hot-gear-project-2/");
            PushButton     val2           = val.AddItem(new PushButtonData("HotGear_IPE", "Instance", HotGearPackage.AddInPath, "InstanceParameterCollector")) as PushButton;

            val2.set_ToolTip("Collect Project Instance Elements Data");
            val2.set_LargeImage(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Instance.png"));
            val2.set_Image(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Instance_s.png"));
            val2.SetContextualHelp(contextualHelp);
            val.AddSeparator();
            PushButton val3 = val.AddItem(new PushButtonData("HotGear_TPE", "Type", HotGearPackage.AddInPath, "TypeParameterCollector")) as PushButton;

            val3.set_ToolTip("Collect Project Type Elements Data");
            val3.set_LargeImage(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Type.png"));
            val3.set_Image(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Type_s.png"));
            val3.SetContextualHelp(contextualHelp);
            return(0);
        }
Beispiel #15
0
 public Result OnStartup(UIControlledApplication application)
 {
     //IL_0009: Unknown result type (might be due to invalid IL or missing references)
     //IL_0032: Unknown result type (might be due to invalid IL or missing references)
     //IL_0048: Unknown result type (might be due to invalid IL or missing references)
     //IL_004a: Unknown result type (might be due to invalid IL or missing references)
     //IL_004f: Unknown result type (might be due to invalid IL or missing references)
     //IL_0054: Unknown result type (might be due to invalid IL or missing references)
     //IL_0057: Unknown result type (might be due to invalid IL or missing references)
     //IL_005c: Unknown result type (might be due to invalid IL or missing references)
     //IL_005e: Unknown result type (might be due to invalid IL or missing references)
     //IL_0075: Unknown result type (might be due to invalid IL or missing references)
     //IL_007a: Unknown result type (might be due to invalid IL or missing references)
     //IL_007f: Expected O, but got Unknown
     //IL_007f: Unknown result type (might be due to invalid IL or missing references)
     //IL_0084: Unknown result type (might be due to invalid IL or missing references)
     //IL_0086: Unknown result type (might be due to invalid IL or missing references)
     //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
     //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
     //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
     //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
     //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
     //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
     //IL_00f9: Unknown result type (might be due to invalid IL or missing references)
     //IL_010e: Unknown result type (might be due to invalid IL or missing references)
     //IL_0113: Unknown result type (might be due to invalid IL or missing references)
     try
     {
         string text = "HTSS Add-Ins";
         try
         {
             application.CreateRibbonTab(text);
         }
         catch (ArgumentException)
         {
         }
         catch (InvalidOperationException)
         {
             text = string.Empty;
         }
         string      text2 = "Family Manager Basic";
         string      text3 = "Family Manager Basic";
         RibbonPanel val3  = null;
         val3 = ((!(text == string.Empty)) ? application.CreateRibbonPanel(text, text2) : application.CreateRibbonPanel(text2));
         PushButton val4 = val3.AddItem(new PushButtonData(text3, text3, FamMgrBasicAppln.AddInPath, typeof(FamMgrBasicCmd).FullName));
         val4.set_LargeImage((ImageSource) new BitmapImage(new Uri(Path.Combine(FamMgrBasicAppln.IconsFolder, "FM32.png"), UriKind.Absolute)));
         val4.set_Image((ImageSource) new BitmapImage(new Uri(Path.Combine(FamMgrBasicAppln.IconsFolder, "FM32.png"), UriKind.Absolute)));
         val4.set_ToolTip("Load and save families from other revit projects");
         ContextualHelp contextualHelp = new ContextualHelp(3, FamMgrBasicAppln.IconsFolder + "\\FMB_help.chm");
         val4.SetContextualHelp(contextualHelp);
         return(0);
     }
     catch (Exception ex)
     {
         FamMgr_Util.ShowMessage(ex.ToString());
         return(-1);
     }
 }
 private void AddPushButton(RibbonPanel panel)
 {
     PushButton pushButton = panel.AddItem(new PushButtonData("Export", "Export to Boldarc", this.AssemblyFullName, "BoldarcRevitPlugin.Activate")) as PushButton;
     pushButton.ToolTip = "Export to Boldarc";
     ContextualHelp contextualHelp = new ContextualHelp(0, "Boldarc support info goes here.");
     pushButton.SetContextualHelp(contextualHelp);
     //pushButton.set_LargeImage(Imaging.CreateBitmapSourceFromHBitmap(Resources.LogoBig.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()));
     //pushButton.set_Image(Imaging.CreateBitmapSourceFromHBitmap(Resources.LogoSmall.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()));
 }
        private void AddPushButton(RibbonPanel panel)
        {
            PushButton pushButton = panel.AddItem(new PushButtonData("Export", "Export to Boldarc", this.AssemblyFullName, "BoldarcRevitPlugin.Activate")) as PushButton;

            pushButton.ToolTip = "Export to Boldarc";
            ContextualHelp contextualHelp = new ContextualHelp(0, "Boldarc support info goes here.");

            pushButton.SetContextualHelp(contextualHelp);
            //pushButton.set_LargeImage(Imaging.CreateBitmapSourceFromHBitmap(Resources.LogoBig.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()));
            //pushButton.set_Image(Imaging.CreateBitmapSourceFromHBitmap(Resources.LogoSmall.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()));
        }
Beispiel #18
0
        public Result OnStartup(UIControlledApplication application)
        {
            //Create  A button
            RibbonPanel CarboCalcPanel = application.CreateRibbonPanel("CarboLifeCalc");

            //Info
            string         HelpURL        = "https://github.com/DavidVeld/CarboLifeCalc/wiki";
            ContextualHelp contextualHelp = new ContextualHelp(ContextualHelpType.Url, HelpURL);

            //Create  A button
            PushButton pB_CarboCalc = CarboCalcPanel.AddItem(new PushButtonData("CarboLifeCalc", "New Project", MyAssemblyPath, "CarboLifeRevit.CarboLifeCalc")) as PushButton;
            //LImage
            Uri         img_CarboCalc  = new Uri(MyAssemblyDir + @"\img\ico_CarboLife32.png");
            BitmapImage limg_CarboCalc = new BitmapImage(img_CarboCalc);
            //SImahe
            Uri         imgsmll_CarboCalc = new Uri(MyAssemblyDir + @"\img\ico_CarboLife16.png");
            BitmapImage smllimg_CarboCalc = new BitmapImage(imgsmll_CarboCalc);

            pB_CarboCalc.LargeImage = limg_CarboCalc;
            pB_CarboCalc.Image      = smllimg_CarboCalc;
            pB_CarboCalc.SetContextualHelp(contextualHelp);
            pB_CarboCalc.ToolTip = "Create a new Carbo Calc Project using the BIM model";


            PushButton pB_ImportCarboCalc = CarboCalcPanel.AddItem(new PushButtonData("Import CarboLife Calc", "Update Project", MyAssemblyPath, "CarboLifeRevit.CarboLifeCalcUpdate")) as PushButton;
            //LImage
            Uri         img_CarboCalc2  = new Uri(MyAssemblyDir + @"\img\ico_UpdateCarboLife32.png");
            BitmapImage limg_CarboCalc2 = new BitmapImage(img_CarboCalc2);
            //SImahe
            Uri         imgsmll_CarboCalc2 = new Uri(MyAssemblyDir + @"\img\ico_UpdateCarboLife16.png");
            BitmapImage smllimg_CarboCalc2 = new BitmapImage(imgsmll_CarboCalc2);

            pB_ImportCarboCalc.LargeImage = limg_CarboCalc2;
            pB_ImportCarboCalc.Image      = smllimg_CarboCalc2;
            pB_ImportCarboCalc.SetContextualHelp(contextualHelp);
            pB_ImportCarboCalc.ToolTip = "Update an existing Carbo Life Calc Project using the BIM model";

            PushButton pB_CarboCalcPlus = CarboCalcPanel.AddItem(new PushButtonData("CarboLifeCalcSettings", "Settings", MyAssemblyPath, "CarboLifeRevit.CarboLifeCalcPlus")) as PushButton;
            //LImage
            Uri         img_CarboImport  = new Uri(MyAssemblyDir + @"\img\ico_CarboLifeSettings32.png");
            BitmapImage limg_CarboImport = new BitmapImage(img_CarboImport);
            //SImahe
            Uri         imgsmll_CarboImport = new Uri(MyAssemblyDir + @"\img\ico_CarboLifeSettings16.png");
            BitmapImage smllimg_CarboImport = new BitmapImage(imgsmll_CarboImport);

            pB_CarboCalcPlus.LargeImage = limg_CarboImport;
            pB_CarboCalcPlus.Image      = smllimg_CarboImport;
            pB_CarboCalcPlus.SetContextualHelp(contextualHelp);
            pB_CarboCalcPlus.ToolTip = "Advanced export settings";


            return(Result.Succeeded);
        }
        public Result OnStartup(UIControlledApplication application)
        {
            string text = "Hot Gear";

            try
            {
                application.CreateRibbonTab(text);
            }
            catch
            {
            }
            RibbonPanel     val            = application.CreateRibbonPanel(text, "Element Merger");
            ContextualHelp  contextualHelp = new ContextualHelp(2, "https://hotgearproject.gitbooks.io/hotgear-project/content/element_merger.html");
            SplitButtonData val2           = new SplitButtonData("HotGear", "HotGear");
            SplitButton     val3           = val.AddItem(val2) as SplitButton;
            PushButton      val4           = val3.AddPushButton(new PushButtonData("JoinAll", "Join All", HotGearPackage.AddInPath, "JoinAll"));

            val4.set_ToolTip("Join All Selected Category in Project.");
            val4.set_LargeImage(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.JoinAll.png"));
            val4.set_Image(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.JoinAll_s.png"));
            val4.SetContextualHelp(contextualHelp);
            val4 = val3.AddPushButton(new PushButtonData("JoinPush", "Join Selection", HotGearPackage.AddInPath, "JoinElement"));
            val4.set_ToolTip("Join Revit Current Selection Element.");
            val4.set_LargeImage(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Join.png"));
            val4.set_Image(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Join_s.png"));
            val4.SetContextualHelp(contextualHelp);
            val4 = val3.AddPushButton(new PushButtonData("UnjoinPush", "Unjoin Selection", HotGearPackage.AddInPath, "UnjoinElement"));
            val4.set_ToolTip("Unjoin Revit Current Selection Element.");
            val4.set_LargeImage(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Unjoin.png"));
            val4.set_Image(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Unjoin_s.png"));
            val4.SetContextualHelp(contextualHelp);
            val4 = val3.AddPushButton(new PushButtonData("SwitchPush", "Switch Join Order", HotGearPackage.AddInPath, "SwitchJoinOrder"));
            val4.set_ToolTip("Switch Join Order of Revit Current Selection Element.");
            val4.set_LargeImage(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Switch.png"));
            val4.set_Image(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Switch_s.png"));
            val4.SetContextualHelp(contextualHelp);
            val4 = val3.AddPushButton(new PushButtonData("CutPush", "Cut Selection", HotGearPackage.AddInPath, "CutElement"));
            val4.set_ToolTip("Cut Revit Current Selection Element.");
            val4.set_LargeImage(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Cut.png"));
            val4.set_Image(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.Cut_s.png"));
            val4.SetContextualHelp(contextualHelp);
            val4 = val3.AddPushButton(new PushButtonData("UnCutPush", "UnCut Selection", HotGearPackage.AddInPath, "UnCutElement"));
            val4.set_ToolTip("UnCut Revit Current Selection Element.");
            val4.set_LargeImage(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.UnCut.png"));
            val4.set_Image(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.UnCut_s.png"));
            val4.SetContextualHelp(contextualHelp);
            val4 = val3.AddPushButton(new PushButtonData("About", "About", HotGearPackage.AddInPath, "About"));
            val4.set_ToolTip("About HotGear Project");
            val4.set_LargeImage(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.gear32.png"));
            val4.set_Image(HotGearPackage.RetriveImage("HotGearAllInOne.Resources.gear16.png"));
            val4.SetContextualHelp(contextualHelp);
            return(0);
        }
Beispiel #20
0
        }         // end OnShutdown

        private bool AddSplitPushButtons(RibbonPanel rPanel)
        {
            ContextualHelp help = new ContextualHelp(ContextualHelpType.Url, AppStrings.R_CyberStudioDupSheetsAddr);

            try
            {
                // make push button 1
                PushButtonData pbData1 = MakePushButton(
                    rPanel, LocalResMgr.ButtonName,
                    AppStrings.R_ButtonNameTop + nl + AppStrings.R_ButtonNameBott,
                    AppStrings.R_ButtonImage16,
                    AppStrings.R_ButtonImage32,
                    Assembly.GetExecutingAssembly().Location,
                    LocalResMgr.Command, AppStrings.R_CommandDescription);

                if (pbData1 == null)
                {
                    return(false);
                }

                pbData1.SetContextualHelp(help);

                PushButtonData pbData2 = MakePushButton(
                    rPanel, LocalResMgr.ButtonName_1Click,
                    AppStrings.R_ButtonNameTopOneClick + nl + AppStrings.R_ButtonNameBottOneClick,
                    AppStrings.R_ButtonImageOneClick16,
                    AppStrings.R_ButtonImageOneClick32,
                    Assembly.GetExecutingAssembly().Location,
                    LocalResMgr.Command_1Click, AppStrings.R_CommandDescriptionOneClick);

                if (pbData2 == null)
                {
                    return(false);
                }

                SplitButtonData sbd = new SplitButtonData("splitButton", "DupSheets");
                SplitButton     sb  = rPanel.AddItem(sbd) as SplitButton;

                pbData2.SetContextualHelp(help);


                sb.SetContextualHelp(help);

                sb.AddPushButton(pbData1);
                sb.AddPushButton(pbData2);
            }
            catch
            {
                return(false);
            }

            return(true);
        }
 public Frame(Frame other)
 {
     mCharImage      = other.mCharImage;
     mBoxAnchor      = other.mBoxAnchor;
     mBoxSize        = other.mBoxSize;
     mText           = other.mText;
     mFocusRect      = other.mFocusRect;
     mRectType       = other.mRectType;
     mNextButton     = other.mNextButton;
     mContextualHelp = other.mContextualHelp;
     mAction         = other.mAction;
 }
        private void AddPushButtonOfContextHelp(RibbonPanel panel)
        {
            PushButton pushButton = panel.AddItem(new PushButtonData("HelloWorld",
                                                                     "HelloWorld", @"D:\Sample\HelloWorld\bin\Debug\HelloWorld.dll", "HelloWorld.CsHelloWorld")) as PushButton;

            pushButton.ToolTip = "Say Hello World";
            ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.Url,
                                                            "http://www.autodesk.com");

            pushButton.SetContextualHelp(contextHelp);

            pushButton.LargeImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\39-Globe_32x32.png"));
        }
Beispiel #23
0
        /// <summary> 添加“清理冗余”的按钮 </summary>
        private PushButtonData AddPushButtonDataDeleteRedundantExcavations()
        {
            PushButtonData viewStage = new PushButtonData("DeleteRedundantExcavations", "清理冗余", Path.Combine(Path_Dlls, Dll_Projects),
                                                          "OldW.Commands.cmd_DeleteRedundantExcavations");

            viewStage.ToolTip = "将模型土体或者开挖土体族中,没有对应实例的那些族及对应的族类型删除。";

            ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.Url, "http://www.autodesk.com");

            viewStage.SetContextualHelp(contextHelp);
            // Set Icon
            viewStage.Image = new BitmapImage(new Uri(Path.Combine(Path_icons, "Repair2_16.png")));
            return(viewStage);
        }
Beispiel #24
0
        private void AddPushButtonWithImage(RibbonPanel panel, string dllPath, string name, string text, string className, string imagePath)
        {
            PushButtonData buttonData = new PushButtonData(name, text, dllPath, className);
            PushButton     pushButton = panel.AddItem(buttonData) as PushButton;

            // Set ToolTip and contextual help
            pushButton.ToolTip = "Say Hello World";
            ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.Url, "http://www.autodesk.com");

            pushButton.SetContextualHelp(contextHelp);

            // Set the large image shown on button
            pushButton.LargeImage = new BitmapImage(new Uri(imagePath));
        }
Beispiel #25
0
        /// <summary> 添加“手动查看开挖工况”的按钮 </summary>
        private PushButtonData AddPushButtonDataViewStageManually()
        {
            PushButtonData viewStage = new PushButtonData("ViewStageManually", "手动查看", Path.Combine(Path_Dlls, Dll_Projects),
                                                          "OldW.Commands.cmd_ViewStageManually");

            viewStage.ToolTip = "通过在窗口中手动点击在查看任意时间的开挖工况";

            ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.Url, "http://www.autodesk.com");

            viewStage.SetContextualHelp(contextHelp);
            // Set Icon
            viewStage.Image = new BitmapImage(new Uri(Path.Combine(Path_icons, "ViewStage_16.png")));
            return(viewStage);
        }
Beispiel #26
0
        /// <summary> 添加“修复剪切”的按钮 </summary>
        private PushButtonData AddPushButtonDataExcavSoilReCut()
        {
            PushButtonData viewStage = new PushButtonData("ExcavSoilReCut", "修复剪切", Path.Combine(Path_Dlls, Dll_Projects),
                                                          "OldW.Commands.cmd_ExcavSoilReCut");

            viewStage.ToolTip = "修复开挖土体对模型土体的剪切关系。在修复之前请先确保开挖土体与模型土体是位于同一个组“基坑土体”中。";

            ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.Url, "http://www.autodesk.com");

            viewStage.SetContextualHelp(contextHelp);
            // Set Icon
            viewStage.Image = new BitmapImage(new Uri(Path.Combine(Path_icons, "Repair1_16.png")));
            return(viewStage);
        }
Beispiel #27
0
        public Result OnStartup(UIControlledApplication application)
        {
            // Get the absolut path of this assembly
            string ExecutingAssemblyPath = System.Reflection.Assembly.GetExecutingAssembly(
                ).Location;

            // Create a ribbon panel
            RibbonPanel m_projectPanel = application.CreateRibbonPanel(
                "Value Finder");

            //Execute File location
            string fileLctn = NameSpaceNm + ".MainCommand";

            //Button
            PushButton pushButton = m_projectPanel.AddItem(new PushButtonData(
                                                               "Value Finder", "Value Finder", ExecutingAssemblyPath,
                                                               fileLctn)) as PushButton;

            //Add Help ToolTip
            pushButton.ToolTip = NameSpaceNm;

            //Add long description
            pushButton.LongDescription =
                "Search in your model elements with a specific parameter and value. You can filter any category " +
                "that you want, then any parameter and finally select the value that you are looking for.";

            //Icon file location
            string iconFlLctn = NameSpaceNm + ".Resources.Icon.png";

            // Set the large image shown on button.
            pushButton.LargeImage = PngImageSource(
                iconFlLctn);

            // Get the location of the solution DLL
            string path = System.IO.Path.GetDirectoryName(
                System.Reflection.Assembly.GetExecutingAssembly().Location);

            // Combine path with \
            string newpath = Path.GetFullPath(Path.Combine(path, @"..\"));


            ContextualHelp contextHelp = new ContextualHelp(
                ContextualHelpType.Url,
                "https://engworks.com/values-finder/");

            // Assign contextual help to pushbutton
            pushButton.SetContextualHelp(contextHelp);

            return(Result.Succeeded);
        }
Beispiel #28
0
        Result IExternalApplication.OnStartup(UIControlledApplication application)
        {
            try
            {
                Exporter.Instance.settings = new Settings(SaveFormat.ascii, ElementsExportRange.OnlyVisibleOnes, true, true,
                                                          false, false,
                                                          false, 0, 101, 1, 100, 2 /*purgeWrite*/, 8, 7, 4);

                string      str           = "OpenFOAM Exporter";
                RibbonPanel panel         = application.CreateRibbonPanel(str);
                string      directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

                string assemblyname = typeof(OpenFOAMExporterUI).Assembly.GetName().Name;
                string dllName      = directoryName + @"\" + assemblyname + ".dll";

                PushButtonData setupData   = new PushButtonData("OpenFOAM Simulate", "Simulate", dllName, "BIM.OpenFOAMExport.OpenFOAMSimulateCommand");
                PushButton     setupButton = panel.AddItem(setupData) as PushButton;
                using (Stream xstr = new MemoryStream())
                {
                    BIM.Properties.Resources.logo_64.Save(xstr, System.Drawing.Imaging.ImageFormat.Bmp);
                    xstr.Seek(0, SeekOrigin.Begin);
                    BitmapDecoder bdc = new BmpBitmapDecoder(xstr, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad);
                    setupButton.LargeImage = bdc.Frames[0];
                }
                setupButton.ToolTip         = "The OpenFOAM Exporter for Revit is designed to produce a stereolithography file (STL) of your building model and a OpenFOAM-Config.";
                setupButton.LongDescription = "The OpenFOAM Exporter for the Autodesk Revit Platform is a project designed to create an STL file from a 3D building information model for OpenFOAM with a Config-File that includes the boundary conditions for airflow simulation.";
                ContextualHelp help = new ContextualHelp(ContextualHelpType.ChmFile, directoryName + @"\Resources\ADSKSTLExporterHelp.htm");
                setupButton.SetContextualHelp(help);

                PushButtonData data   = new PushButtonData("OpenFOAM Exporter settings", "Settings", dllName, "BIM.OpenFOAMExport.OpenFOAMExportCommand");
                PushButton     button = panel.AddItem(data) as PushButton;
                using (Stream xstr = new MemoryStream())
                {
                    BIM.Properties.Resources.setupIcon.Save(xstr, System.Drawing.Imaging.ImageFormat.Bmp);
                    xstr.Seek(0, SeekOrigin.Begin);
                    BitmapDecoder bdc = new BmpBitmapDecoder(xstr, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad);
                    button.LargeImage = bdc.Frames[0];
                }
                button.ToolTip         = "The OpenFOAM Exporter for Revit is designed to produce a stereolithography file (STL) of your building model and a OpenFOAM-Config.";
                button.LongDescription = "The OpenFOAM Exporter for the Autodesk Revit Platform is a project designed to create an STL file from a 3D building information model for OpenFOAM with a Config-File that includes the boundary conditions for airflow simulation.";
                button.SetContextualHelp(help);

                return(Result.Succeeded);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString(), "OpenFOAM Exporter for Revit");
                return(Result.Failed);
            }
        }
Beispiel #29
0
        public Result OnStartup(UIControlledApplication application)
        {
            // Get the absolut path of this assembly
            string ExecutingAssemblyPath = System.Reflection.Assembly.GetExecutingAssembly(
                ).Location;

            // Create a ribbon panel
            RibbonPanel m_projectPanel = application.CreateRibbonPanel(
                "Clasher");

            //Button
            PushButton pushButton = m_projectPanel.AddItem(new PushButtonData(
                                                               "Clasher", "Clasher", ExecutingAssemblyPath,
                                                               "Clasher.Main")) as PushButton;

            //Add Help ToolTip
            pushButton.ToolTip = "Clash Detection";

            //Add long description
            pushButton.LongDescription =
                "This addin helps you to renumber MEP part with a prefix";

            // Set the large image shown on button.
            pushButton.LargeImage = PngImageSource(
                "Clasher.Resources.ClasherIcon.png");

            // Get the location of the solution DLL
            string path = System.IO.Path.GetDirectoryName(
                System.Reflection.Assembly.GetExecutingAssembly().Location);

            // Combine path with \
            string newpath = Path.GetFullPath(Path.Combine(path, @"..\"));

            // Set the contextual help to point Help.html
            //ContextualHelp contextHelp = new ContextualHelp(
            //    ContextualHelpType.ChmFile,
            //    newpath + "Resources\\Help.html");

            ContextualHelp contextHelp = new ContextualHelp(
                ContextualHelpType.Url,
                "https://engworks.com/Clasher/");

            // Assign contextual help to pushbutton
            pushButton.SetContextualHelp(contextHelp);

            m_MyForm = null; // no dialog needed yet; the command will bring it
            thisApp  = this; // static access to this application instance

            return(Result.Succeeded);
        }
        public Result OnStartup(UIControlledApplication application)
        {
            // Get the absolut path of this assembly
            string ExecutingAssemblyPath = System.Reflection.Assembly.GetExecutingAssembly(
                ).Location;

            // Create a ribbon panel
            RibbonPanel m_projectPanel = application.CreateRibbonPanel(
                NameSpaceNm);

            //Execute File location
            string fileLctn = NameSpaceNm + ".MainCommand";

            //Button
            PushButton pushButton = m_projectPanel.AddItem(new PushButtonData(
                                                               NameSpaceNm, NameSpaceNm, ExecutingAssemblyPath,
                                                               fileLctn)) as PushButton;

            //Add Help ToolTip
            pushButton.ToolTip = NameSpaceNm;

            //Add long description
            pushButton.LongDescription =
                "This addin helps you to ...";

            //Icon file location
            string iconFlLctn = NameSpaceNm + ".Resources.Icon.png";

            // Set the large image shown on button.
            pushButton.LargeImage = PngImageSource(
                iconFlLctn);

            // Get the location of the solution DLL
            string path = System.IO.Path.GetDirectoryName(
                System.Reflection.Assembly.GetExecutingAssembly().Location);

            // Combine path with \
            string newpath = Path.GetFullPath(Path.Combine(path, @"..\"));


            ContextualHelp contextHelp = new ContextualHelp(
                ContextualHelpType.Url,
                "https://google.com");

            // Assign contextual help to pushbutton
            pushButton.SetContextualHelp(contextHelp);

            return(Result.Succeeded);
        }
        private static void AddRibbonPanel(UIControlledApplication application)
        {
            RibbonPanel    val      = application.CreateRibbonPanel("Shadow Analysis 2 Exporter");
            string         location = Assembly.GetExecutingAssembly().Location;
            PushButtonData val2     = new PushButtonData("cmdCurveTotalLength", "Export" + Environment.NewLine + "  model  ", location, "ShadowAnalysisExporter.MainExport");
            object         obj      = (object)(val.AddItem(val2) as PushButton);

            obj.set_ToolTip("Shadow Analysis 2 Exporter");
            BitmapImage largeImage = new BitmapImage(new Uri("pack://application:,,,/ShadowAnalysisExporter;component/Resources/shadow_logo.png"));

            obj.set_LargeImage((ImageSource)largeImage);
            ContextualHelp contextualHelp = new ContextualHelp(2, "http://deltacodes.pl/ShadowAnalysis2_Exporter_for_Revit-help");

            obj.SetContextualHelp(contextualHelp);
        }
Beispiel #32
0
        /// <summary> 添加“隐藏指定标高范围由的线管”的按钮 </summary>
        private void AddPushButtonHideConduit(RibbonPanel panel)
        {
            // Create a new push button
            PushButton pushButton =
                panel.AddItem(new PushButtonData("HideConduit", "隐藏线管", Path.Combine(Path_Dlls, Dll_eZRvt),
                                                 "eZRvt.Commands.cmd_HideConduit")) as PushButton;

            pushButton.ToolTip = "隐藏指定标高范围由的线管";
            // Set Contextual help
            ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.Url, "http://www.cmie.cn");

            pushButton.SetContextualHelp(contextHelp);
            // Set Icon
            pushButton.LargeImage = new BitmapImage(new Uri(Path.Combine(Path_icons, "Filter_32.png")));
        }
Beispiel #33
0
        //******************************************************************************
        //**************Ribbon Creation Example*****************************************
        private void BiuldExampleRibbon()
        {
            //Creates Tab and Panel
            ThisAppRibbon = new Ribbon(ThisUIApp, "Example Panel");

            //Loads contextual help from resources
            ContextualHelp Help = new ContextualHelp(ContextualHelpType.ChmFile,
                                                     Path.GetDirectoryName(AssemblyPath) + @"\Engineering Lighting Tools.chm");

            //Adds Push Button 1
            ThisAppRibbon.AddPushButton("Command 1", "Run Command 1"
                                        , AssemblyPath, "EntryPoint.RevitCommands.Command1",
                                        "Lighting Fixtures Costs Manager", Help,
                                        "EntryPoint.RevitCommands.Command1");
        }
Beispiel #34
0
        private void AddRibbonPanel(UIControlledApplication app)
        {
            RibbonPanel panel = app.CreateRibbonPanel("STF Exporter: v" + Assembly.GetExecutingAssembly().GetName().Version);

            PushButtonData pbd_STF = new PushButtonData("STFExport", "Export STF File", assyPath, "STFExporter.Command");
            PushButton pb_STFbutton = panel.AddItem(pbd_STF) as PushButton;
            pb_STFbutton.LargeImage = iconImage("STFExporter.icons.stfexport_32.png");
            pb_STFbutton.ToolTip = "Export Revit Spaces to STF File";
            pb_STFbutton.LongDescription = "Exports Spaces in Revit model to STF file for use in application such as DIALux";

            //ContextualHe/lp contextHelp = new ContextualHelp(ContextualHelpType.ChmFile, dir + "/Resources/STFExporter Help.htm");
            ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.Url, "https://github.com/kmorin/STF-Exporter");

            pb_STFbutton.SetContextualHelp(contextHelp);
        }
Beispiel #35
0
        public Result OnStartup(UIControlledApplication application)
        {
            var path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\\Autodesk\\Revit\\Addins\\2013\\BIMXchange.bundle";

            const string str = "CDWKS.RevitAddon.BXC2013.dll";
            var ribbonPanel = application.CreateRibbonPanel("ENGworks");
            var pushButtonDatum = new PushButtonData("BIMXchange v4.0", "BIMXchange v4.0", string.Format("{0}\\{1}",path,str),
                                                     "CDWKS.RevitAddon.BXC2013.Command");
            var ribbonItem = ribbonPanel.AddItem(pushButtonDatum);
            var pushButton = ribbonItem as PushButton;
            var contextHelp = new ContextualHelp(
                ContextualHelpType.ChmFile,
                path + @"\Contents\Resources\ENGworks.BIMXchange.htm");
            pushButton.SetContextualHelp(contextHelp);
            var str1 = path.Substring(0, path.Length - str.Length);
            var uri = new Uri(string.Concat(path, "\\Library_32.png"));
            pushButton.LargeImage = (new BitmapImage(uri));
            return Result.Succeeded;
        }
Beispiel #36
0
        public Result OnStartup(UIControlledApplication a)
        {
            // Add a new ribbon panel
            RibbonPanel ribbonPanel = a.CreateRibbonPanel("Sheet Index Tools");

            // Create a push button to trigger a command add it to the ribbon panel.
            string thisAssemblyPath = Assembly.GetExecutingAssembly().Location;
            string AddInPath = typeof(App).Assembly.Location;
            string AddFolder = Path.GetDirectoryName(AddInPath);
            string helpPath = AddFolder + "\\PrintIndexHelp.html";
            ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.Url,helpPath);

            PushButtonData button1Data = new PushButtonData("cmdPfI",
                "Print Index", thisAssemblyPath, "PrintIndex.Command");

            PushButton pushButton1 = ribbonPanel.AddItem(button1Data) as PushButton;
            pushButton1.ToolTip = "Click to select your sheet index and save as a printable set.";
            pushButton1.LargeImage = new BitmapImage(new Uri(Path.Combine(AddFolder, "PanelIconButton.bmp"),UriKind.Absolute));
            pushButton1.SetContextualHelp(contextHelp);

            return Result.Succeeded;
        }
 Result IExternalApplication.OnStartup(UIControlledApplication application)
 {
     try
      {
     string str = "STL Exporter";
     RibbonPanel panel = application.CreateRibbonPanel(str);
     string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
     PushButtonData data = new PushButtonData("STL Exporter for Revit", "STL Exporter for Revit", directoryName + @"\STLExport.dll", "BIM.STLExport.STLExportCommand");
     PushButton button = panel.AddItem(data) as PushButton;
     button.LargeImage = LoadPNGImageFromResource("BIM.STLExport.Resources.STLExporter_32.png");
     button.ToolTip = "The STL Exporter for Revit is designed to produce a stereolithography file (STL) of your building model.";
     button.LongDescription = "The STL Exporter for the Autodesk Revit Platform is a proof-of-concept project designed to create an STL file from a 3D building information model, thereby enabling easier 3D printing.";
     ContextualHelp help = new ContextualHelp(ContextualHelpType.ChmFile, directoryName + @"\Resources\ADSKSTLExporterHelp.htm");
     button.SetContextualHelp(help);
     return Result.Succeeded;
      }
      catch (Exception exception)
      {
     MessageBox.Show(exception.ToString(), "STL Exporter for Revit");
     return Result.Failed;
      }
 }
Beispiel #38
0
        private void AddRibbonPanel(UIControlledApplication app)
        {
            RibbonPanel panel = app.CreateRibbonPanel("NWC View Exporter");
            PushButtonData pbd_Options = new PushButtonData("Export Options", "Export Options", assyPath, "NWCViewExporter.Options");
            PushButtonData pbd_Sub = new PushButtonData("Subscribe", "Auto NWC ON", assyPath, "NWCViewExporter.SubscribeToEvent");
            pbd_Sub.LargeImage = NewBitmapImage("sub.png");
            pbd_Sub.ToolTip = "Turn ON Automatic NWC file creation after each save.";
            pbd_Sub.LongDescription = "Automatically creates an NWC Navisworks file after each time the project is saved. The selected view in the options dialog is used as the exported view. The NWC file is saved in the directory specified in the options dialog.";
            PushButtonData pbd_Unsub = new PushButtonData("Unsubscribe", "Auto NWC OFF", assyPath, "NWCViewExporter.UnsubscribeFromEvent");
            pbd_Unsub.LargeImage = NewBitmapImage("unsub.png");
            pbd_Unsub.ToolTip = "Turn OFF Automatic NWC file creation.";
            pbd_Unsub.LongDescription = "Turns off the automatic NWC file creator.";

            PushButton pb_Options = panel.AddItem(pbd_Options) as PushButton;
            //pb_Options.LargeImage = NewBitmapImage("options.png");
            pb_Options.LargeImage = GetEmbeddedImage("NWCViewExporter.options.png");
            pb_Options.ToolTip = "Set Options for Automatic NWC Creation";
            pb_Options.LongDescription = "Sets the view to use for Automatic NWC creation on each save as well as the destination folder to save the NWC file.";

            panel.AddSeparator();
            IList<RibbonItem> stacked = panel.AddStackedItems(pbd_Sub, pbd_Unsub);

            //Context help
            ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.ChmFile, dir + "/Resources/help.htm");

            pb_Options.SetContextualHelp(contextHelp);

            foreach (RibbonItem ri in stacked)
            {
                ri.SetContextualHelp(contextHelp); //set contextHelp for stacked items;
                if (ri.Name == "Subscribe")
                    ri.Enabled = true;
                else
                    ri.Enabled = false;
            }
        }
    Result IExternalApplication.OnStartup(
      UIControlledApplication application)
    {
      try
      {
        // create a Ribbon panel which contains three 
        // stackable buttons and one single push button

        string firstPanelName = "Upgrader";
        RibbonPanel panel = application.CreateRibbonPanel(
          firstPanelName);

        // set the information about the command we will 
        // be assigning to the button 

        PushButtonData pushButtonData = new PushButtonData(
          "FileUpgrader", 
          "File Upgrader", 
          AddInPath, 
          "ADNPlugin.Revit.FileUpgrader.Command");

        //' add a button to the panel 

        PushButton pushButton = panel.AddItem(pushButtonData)
          as PushButton;

        //' add an icon 

        pushButton.LargeImage = LoadPNGImageFromResource(
        "ADNPlugin.Revit.FileUpgrader.upgrade_32by32.png");

        // add a tooltip 
        pushButton.ToolTip = 
          "Upgrade old version Revit documents to current one.";

        // long description

        pushButton.LongDescription =
             "Specify the Source folder that contains a set of Revit files, " + 
             "and Destination folders where you want to save upgraded files.";

        // Context (F1) Help - new in 2013 
        //string appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); // %AppData% 

        string path;
        path = System.IO.Path.GetDirectoryName(
           System.Reflection.Assembly.GetExecutingAssembly().Location);

        ContextualHelp contextHelp = new ContextualHelp(
            ContextualHelpType.ChmFile,
            path + "/Resources/ADNFileUpgraderHelp.htm"); // hard coding for simplicity. 

        pushButton.SetContextualHelp(contextHelp);

        return Autodesk.Revit.UI.Result.Succeeded;
      }
      catch (Exception ex)
      {
        MessageBox.Show(ex.ToString(), "File Upgrader Ribbon");
        return Autodesk.Revit.UI.Result.Failed;
      }
    }