Ejemplo n.º 1
0
        /// <summary>
        /// Radio/toggle button for "Command Data", "DB Element" and "Element Filtering"
        /// </summary>
        public void AddRadioButton(RibbonPanel panel)
        {
            // Create three toggle buttons for radio button group

            // #1
            ToggleButtonData toggleButtonData1 = new ToggleButtonData("RadioCommandData", "Command" + "\n Data", _introLabPath, _introLabName + ".CommandData");

            toggleButtonData1.LargeImage = NewBitmapImage("Basics.ico");

            // #2
            ToggleButtonData toggleButtonData2 = new ToggleButtonData("RadioDbElement", "DB" + "\n Element", _introLabPath, _introLabName + ".DBElement");

            toggleButtonData2.LargeImage = NewBitmapImage("Basics.ico");

            // #3
            ToggleButtonData toggleButtonData3 = new ToggleButtonData("RadioElementFiltering", "Filtering", _introLabPath, _introLabName + ".ElementFiltering");

            toggleButtonData3.LargeImage = NewBitmapImage("Basics.ico");

            // Make a radio button group now
            RadioButtonGroupData radioBtnGroupData = new RadioButtonGroupData("RadioButton");
            RadioButtonGroup     radioBtnGroup     = panel.AddItem(radioBtnGroupData) as RadioButtonGroup;

            radioBtnGroup.AddItem(toggleButtonData1);
            radioBtnGroup.AddItem(toggleButtonData2);
            radioBtnGroup.AddItem(toggleButtonData3);
        }
Ejemplo n.º 2
0
        public void addVRCommandButtons(RibbonPanel panel)
        {
            string thisAssemblyPath = Assembly.GetExecutingAssembly().Location;

            ////Set globel directory
            var globePathOn = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "Onbtn.gif");
            var globePathOff = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "Offbtn.gif");

            //Large image button on
            Uri uriImageOn = new Uri(globePathOn);
            BitmapImage largeimageOn = new BitmapImage(uriImageOn);
            //Large image button off
            Uri uriImageOff = new Uri(globePathOff);
            BitmapImage largeimageOff = new BitmapImage(uriImageOff);

            //Create toggle buttons for radio button group.

            //Image setup for buttons
            ToggleButtonData toggleButtonDataON =
                new ToggleButtonData("ViewCellAlignON", "ON\nAlign Cell", thisAssemblyPath, "SOM.RevitTools.AlignViewToSheetCell.UIDynamicUpdateOn");

            ToggleButtonData toggleButtonDataOFF =
                new ToggleButtonData("ViewCellAlignOFF", "OFF\nAlign Cell", thisAssemblyPath, "SOM.RevitTools.AlignViewToSheetCell.UIDynamicUpdateOff");

            toggleButtonDataON.LargeImage = largeimageOn;
            toggleButtonDataOFF.LargeImage = largeimageOff;

            //Make dyn update on/off radio button group
            RadioButtonGroupData radioBtnGroupData = new RadioButtonGroupData("Sheet View Organization");

            RadioButtonGroup radioBtnGroup = panel.AddItem(radioBtnGroupData) as RadioButtonGroup;

            radioBtnGroup.AddItem(toggleButtonDataON);
            radioBtnGroup.AddItem(toggleButtonDataOFF);
        }
Ejemplo n.º 3
0
        public Result OnStartup(UIControlledApplication application)
        {
            PublicVariables.UpperValue = 10000;
            PublicVariables.LowerValue = 0;
            application.CreateRibbonTab("Updater Tool");
            string appData       = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            string dllPath       = Path.Combine(appData, @"Autodesk\REVIT\Addins\2020\UpdaterTool.dll");
            string appFolderPath = Path.Combine(appData, @"Autodesk\REVIT\Addins\2020");

            RibbonPanel ribbonPanel = application.CreateRibbonPanel("Updater Tool", "Updater");

            TextBoxData textBoxData1 = new TextBoxData("textBox1");
            TextBox     textBox1     = ribbonPanel.AddItem(textBoxData1) as TextBox;

            textBox1.PromptText    = "Enter a Reference Value";
            textBox1.EnterPressed += TextBoxEnterClicked;
            ribbonPanel.AddSeparator();
            RadioButtonGroupData radioButtonGroupData1 = new RadioButtonGroupData("radioButtonGroup1");
            RadioButtonGroup     radioButtonGroup1     = ribbonPanel.AddItem(radioButtonGroupData1) as RadioButtonGroup;

            ToggleButtonData toggleButton1 = new ToggleButtonData("toggleButton1", "Deactivate", dllPath, "UpdaterTool.Deactivated");
            BitmapImage      img1          = new BitmapImage(new Uri(Path.Combine(appFolderPath, "Stop.png")));

            toggleButton1.LargeImage = img1;

            ToggleButtonData toggleButton2 = new ToggleButtonData("toggleButton2", "Activate", dllPath, "UpdaterTool.Activated");
            BitmapImage      img2          = new BitmapImage(new Uri(Path.Combine(appFolderPath, "Check.png")));

            toggleButton2.LargeImage = img2;

            radioButtonGroup1.AddItem(toggleButton1);
            radioButtonGroup1.AddItem(toggleButton2);

            return(Result.Succeeded);
        }
Ejemplo n.º 4
0
        //Control buttons for the dynamic model update
        public void addVRCommandButtons(RibbonPanel panel)
        {
            string thisAssemblyPath = Assembly.GetExecutingAssembly().Location;

            ////Set globel directory
            var globePathOn = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "Onbtn.gif");
            var globePathOff = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "Offbtn.gif");
            var globePathToolTipOn = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "VRPreviewON.JPG");
            var globePathToolTipOff = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "VRPreviewOff.JPG");

            //Large image button on
            Uri uriImageOn = new Uri(globePathOn);
            BitmapImage largeimageOn = new BitmapImage(uriImageOn);
            //Large image button off
            Uri uriImageOff = new Uri(globePathOff);
            BitmapImage largeimageOff = new BitmapImage(uriImageOff);

            //Large image tool tip
            Uri uriImageToolTipOn = new Uri(globePathToolTipOn);
            BitmapImage largeimageToolTipOn = new BitmapImage(uriImageToolTipOn);
            Uri uriImageToolTipOff = new Uri(globePathToolTipOff);
            BitmapImage largeimageToolTipOff = new BitmapImage(uriImageToolTipOff);

            //Create toggle buttons for radio button group.

            //Image setup for buttons
            ToggleButtonData toggleButtonDataON =
                new ToggleButtonData("ViewportRenameON", "ON\nRename View", thisAssemblyPath, "SOM.RevitTools.ViewportRename.UIDynamicModelUpdateOn");

            ToggleButtonData toggleButtonDataOFF =
                new ToggleButtonData("ViewportRenameOFF", "OFF\nRename View", thisAssemblyPath, "SOM.RevitTools.ViewportRename.UIDynamicModelUpdateOff");
            toggleButtonDataON.LargeImage = largeimageOn;
            toggleButtonDataOFF.LargeImage = largeimageOff;

            //Tooltip image setup
            toggleButtonDataON.ToolTip = "Enable project organization by: \nSheet Number-Detail Number-Title on Sheet.";
            toggleButtonDataON.ToolTipImage = largeimageToolTipOn;
            toggleButtonDataOFF.ToolTip = "Disable or temporarily turn off View Rename add-in.";
            toggleButtonDataOFF.ToolTipImage = largeimageToolTipOff;
            //toggleButtonDataON.LongDescription = "<p>Hello,</p><p>I am RadioButtonGroup #1.</p><p>Regards,</p>";
            //toggleButtonDataOFF.LongDescription = "<p>Hello,</p><p>I am RadioButtonGroup #1.</p><p>Regards,</p>";

            //Make dyn update on/off radio button group
            RadioButtonGroupData radioBtnGroupData = new RadioButtonGroupData("Project View Organization");

            RadioButtonGroup radioBtnGroup = panel.AddItem(radioBtnGroupData) as RadioButtonGroup;

            radioBtnGroup.AddItem(toggleButtonDataON);
            radioBtnGroup.AddItem(toggleButtonDataOFF);
        }
Ejemplo n.º 5
0
        //进行各种按钮的属性设置
        public void AddButtonIteam(ref RibbonPanel ribbon, string buttonType, string tabName, string buttonText, string assemblyName, string className, string largeImageuri, string toolTip, string longDescription)
        {
            switch (buttonType)
            {
            case "PushButton":
                PushButtonData pbd = new PushButtonData(tabName, buttonText, assemblyName, className);    //tabName可用可不用?
                SetPushButtonAttribute(ref ribbon, pbd, largeImageuri, toolTip, longDescription);
                break;

            case "PulldownButton":
                PulldownButtonData pdbd = new PulldownButtonData("柱", "柱");
                SetPulldownButtonAttribute(ref ribbon, assemblyName, className, pdbd, largeImageuri, toolTip, longDescription);

                break;

            case "SplitButton":
                SplitButtonData sbd = new SplitButtonData("板", "板");
                //SetButtonAttribute(pbd, largeImageuri, toolTip, longDescription);

                break;

            case "ComboBox":
                ComboBoxData cbd = new ComboBoxData("");
                //SetButtonAttribute(pbd, largeImageuri, toolTip, longDescription);

                break;

            case "RadioButtonGroup":
                RadioButtonGroupData rbgd = new RadioButtonGroupData("");
                //SetButtonAttribute(pbd, largeImageuri, toolTip, longDescription);

                break;

            case "ToggleButton":
                ToggleButtonData tbd = new ToggleButtonData("", "");
                //SetButtonAttribute(pbd, largeImageuri, toolTip, longDescription);

                break;

            case "TextBox":
                TextBoxData textbd = new TextBoxData("");
                //SetButtonAttribute(pbd, largeImageuri, toolTip, longDescription);

                break;

            default:
                break;
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Control buttons for Event and Dynamic Model Update
        /// </summary>
        public void AddUILabsCommandButtons2(RibbonPanel panel)
        {
            // Get the location of this dll.
            string assembly = GetType().Assembly.Location;

            // Create three toggle buttons for radio button group
            // #1
            ToggleButtonData toggleButtonData1 = new ToggleButtonData("UILabsEventOn", "Event" + "\n Off", assembly, _uiLabName + ".UIEventOff");

            toggleButtonData1.LargeImage = NewBitmapImage("Basics.ico");

            // #2
            ToggleButtonData toggleButtonData2 = new ToggleButtonData("UILabsEventOff", "Event" + "\n On", assembly, _uiLabName + ".UIEventOn");

            toggleButtonData2.LargeImage = NewBitmapImage("Basics.ico");

            // Create three toggle buttons for radio button group
            // #3
            ToggleButtonData toggleButtonData3 = new ToggleButtonData("UILabsDynUpdateOn", "Center" + "\n Off", assembly, _uiLabName + ".UIDynamicModelUpdateOff");

            toggleButtonData3.LargeImage = NewBitmapImage("Families.ico");

            // #4
            ToggleButtonData toggleButtonData4 = new ToggleButtonData("UILabsDynUpdateOff", "Center" + "\n On", assembly, _uiLabName + ".UIDynamicModelUpdateOn");

            toggleButtonData4.LargeImage = NewBitmapImage("Families.ico");

            // Make event pn/off radio button group
            RadioButtonGroupData radioBtnGroupData1 = new RadioButtonGroupData("EventNotification");
            RadioButtonGroup     radioBtnGroup1     = panel.AddItem(radioBtnGroupData1) as RadioButtonGroup;

            radioBtnGroup1.AddItem(toggleButtonData1);
            radioBtnGroup1.AddItem(toggleButtonData2);

            // Make dyn update on/off radio button group
            RadioButtonGroupData radioBtnGroupData2 = new RadioButtonGroupData("WindowDoorCenter");
            RadioButtonGroup     radioBtnGroup2     = panel.AddItem(radioBtnGroupData2) as RadioButtonGroup;

            radioBtnGroup2.AddItem(toggleButtonData3);

            radioBtnGroup2.AddItem(toggleButtonData4);
        }
Ejemplo n.º 7
0
        public override RibbonItemData GetItemData()
        {
            ToggleButtonData data = new ToggleButtonData(_name, _text, _assemblyLocation, _className);

            if (string.IsNullOrWhiteSpace(_toolTips))
            {
                data.ToolTip = _toolTips;
            }
            if (string.IsNullOrWhiteSpace(_description))
            {
                data.LongDescription = _description;
            }
            if (_smallImage != null)
            {
                data.Image = _smallImage;
            }
            if (_toolTipsImage != null)
            {
                data.ToolTipImage = _toolTipsImage;
            }
            return(data);
        }
        private void AddRadioGroup(RibbonPanel panel)
        {
            RadioButtonGroupData radioData        = new RadioButtonGroupData("radioGroup");
            RadioButtonGroup     radioButtonGroup = panel.AddItem(radioData) as RadioButtonGroup;

            ToggleButtonData tb1 = new ToggleButtonData("toggleButton1", "Red");

            tb1.ToolTip    = "Red Option";
            tb1.LargeImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\Red.bmp"));
            ToggleButtonData tb2 = new ToggleButtonData("toggleButton2", "Green");

            tb2.ToolTip    = "Green Option";
            tb2.LargeImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\Green.bmp"));
            ToggleButtonData tb3 = new ToggleButtonData("toggleButton3", "Blue");

            tb3.ToolTip    = "Blue Option";
            tb3.LargeImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\Blue.bmp"));

            radioButtonGroup.AddItem(tb1);
            radioButtonGroup.AddItem(tb2);
            radioButtonGroup.AddItem(tb3);
        }
Ejemplo n.º 9
0
        internal static void AddRibbonPanel(UIControlledApplication application)
        {
            //Tab Name that will display in Revit
            string TabName = "Torsion Tools";

            //Create the Ribbon Tab
            application.CreateRibbonTab(TabName);

            //Get the assembly path to execute commands
            string AssemblyPath = Assembly.GetExecutingAssembly().Location;

            //Create an Image to display on the buttons
            BitmapImage ButtonImage                              = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/Button100x100.png"));
            BitmapImage FindReplaceImage                         = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/FindReplace100x100.png"));
            BitmapImage SheetCapitalizeImage                     = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/ToUpper100x100.png"));
            BitmapImage SheetSelectionImage                      = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/SheetSelection100x100.png"));
            BitmapImage SheetTitleblockKeyPlanImage              = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/SheetTitleblockKeyPlan100x100.png"));
            BitmapImage SheetViewRefSheetImage                   = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/SheetViewRefSheet100x100.png"));
            BitmapImage ViewsViewLegendCopyImage                 = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/ViewLegendCopy100x100.png"));
            BitmapImage ViewsViewScheduleCopyImage               = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/ViewScheduleCopy100x100.png"));
            BitmapImage ViewsLinkedViewsImage                    = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/LinkedView100x100.png"));
            BitmapImage ViewsLinkedViewsUpdateImage              = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/LinkedViewUpdate100x100.png"));
            BitmapImage ViewsViewDeleteunplacedImage             = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/ViewDeleteUnplaced100x100.png"));
            BitmapImage ToolsWarningsImage                       = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/Warning100x100.png"));
            BitmapImage ToolsElemOfCategoryImage                 = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/ComponentInfo100x100.png"));
            BitmapImage ToolsSheetLegendMultipleImage            = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/SheetLegendToMultiple100x100.png"));
            BitmapImage ToolsSheetScheduleMultipleImage          = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/SheetScheduleToMultiple100x100.png"));
            BitmapImage ToolsFamilyMultipleSharedParametersImage = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/MultipleSharedParameters100x100.png"));
            BitmapImage SquareTImage                             = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/SquareT100x100.png"));
            BitmapImage ViewsChangeViewReferenceImage            = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/ChangeViewReference100x100.png"));
            BitmapImage MEPSpacesFromLinkedRoomsImage            = new BitmapImage(new Uri("pack://application:,,,/Torsion Tools;component/Resources/CreateSpaces100x100.png"));


            //Create a Panel within the Tab
            RibbonPanel RibbonPanelOne      = application.CreateRibbonPanel(TabName, "PANEL 1");
            RibbonPanel RibbonPanelSheets   = application.CreateRibbonPanel(TabName, "Sheets");
            RibbonPanel RibbonPanelViews    = application.CreateRibbonPanel(TabName, "Views");
            RibbonPanel RibbonPanelTools    = application.CreateRibbonPanel(TabName, "Tools");
            RibbonPanel RibbonPanelMEP      = application.CreateRibbonPanel(TabName, "MEP");
            RibbonPanel RibbonPanelSettings = application.CreateRibbonPanel(TabName, "Settings");

            //Create Push Button Data to create the Push button from
            PushButtonData pbdTestButton             = new PushButtonData("cmdTestButton", "Button Name", AssemblyPath, "TorsionTools.Commands.HelloWorld");
            PushButtonData pbdSheetSelection         = new PushButtonData("cmdSheetSelection", "Sheet\nSelector", AssemblyPath, "TorsionTools.Commands.SheetSelection");
            PushButtonData pbdSheetFindReplace       = new PushButtonData("cmdSheetFindReplace", "Sheets\nFind Replace", AssemblyPath, "TorsionTools.Commands.SheetFindReplace");
            PushButtonData pbdSheetNameCapitalize    = new PushButtonData("cmdSheetNameCapitalize", "Capitalize\nName", AssemblyPath, "TorsionTools.Commands.SheetNameCapitalize");
            PushButtonData pbdSheetTitleblockKeyPlan = new PushButtonData("cmdSheetTitleblockKeyPlan", "Key Plan\nVisibility", AssemblyPath, "TorsionTools.Commands.SheetTitleblockKeyPlan");
            PushButtonData pbdSheetLegendToMultiple  = new PushButtonData("cmdSheetLegendToMultiple", "Place\nLegends", AssemblyPath, "TorsionTools.Commands.SheetLegendToMultiple")
            {
                //Use the PushButtonData property to determine when the ribbon button is enabled. In this case only when the active view is a Sheet
                AvailabilityClassName = "TorsionTools.Ribbon.SheetCommandAvailability"
            };
            PushButtonData pbdSheetScheduleToMultiple = new PushButtonData("cmdSheetScheduleToMultiple", "Place\nSchedules", AssemblyPath, "TorsionTools.Commands.SheetScheduleToMultiple")
            {
                //Use the PushButtonData property to determine when the ribbon button is enabled. In this case only when the active view is a Sheet
                AvailabilityClassName = "TorsionTools.Ribbon.SheetCommandAvailability"
            };
            PushButtonData pbdSheetViewReferenceSheet = new PushButtonData("cmdSheetViewReferenceSheet", "Reference\nSheet", AssemblyPath, "TorsionTools.Commands.ViewReferenceSheet")
            {
                //Use the PushButtonData property to determine when the ribbon button is enabled. In this case only when the active view is a Sheet
                AvailabilityClassName = "TorsionTools.Ribbon.SheetCommandAvailability"
            };

            PushButtonData pbdViewsFindReplace         = new PushButtonData("cmdViewsFindReplace", "Views\nFind Replace", AssemblyPath, "TorsionTools.Commands.ViewFindReplace");
            PushButtonData pbdViewsViewLegendCopy      = new PushButtonData("cmdToolsViewLegendCopy", "Copy\nLegends", AssemblyPath, "TorsionTools.Commands.ViewLegendCopy");
            PushButtonData pbdViewsViewScheduleCopy    = new PushButtonData("cmdToolsViewScheduleCopy", "Copy\nSchedules", AssemblyPath, "TorsionTools.Commands.ViewScheduleCopy");
            PushButtonData pbdViewsLinkedViews         = new PushButtonData("cmdToolsLinkedViews", "Linked\nViews", AssemblyPath, "TorsionTools.Commands.LinkedViews");
            PushButtonData pbdViewsLinkedViewsUpdate   = new PushButtonData("cmdToolsLinkedViewsUpdate", "Update\nViews", AssemblyPath, "TorsionTools.Commands.LinkedViewUpdate");
            PushButtonData pbdViewsViewDeleteUnplaced  = new PushButtonData("cmdToolsViewDeleteUnplaced", "Delete\nUnplaced", AssemblyPath, "TorsionTools.Commands.ViewDeleteUnplacedViews");
            PushButtonData pbdViewsChangeViewReference = new PushButtonData("cmdViewsChangeViewReference", "Change\nReference", AssemblyPath, "TorsionTools.Commands.ViewChangeViewReference");
            PushButtonData pbdViewActiveToSheet        = new PushButtonData("cmdViewActiveToSheet", "Active View\nTo Sheet", AssemblyPath, "TorsionTools.Commands.ViewActiveToSheet")
            {
                AvailabilityClassName = "TorsionTools.Ribbon.ViewCommandAvailability"
            };

            PushButtonData pbdToolsWarnings       = new PushButtonData("cmdToolsWarnings", "Warnings", AssemblyPath, "TorsionTools.Commands.Warnings");
            PushButtonData pbdToolsElemOfCategory = new PushButtonData("cmdToolsElemOfCategory", "Family Instances\nof Category", AssemblyPath, "TorsionTools.Commands.ElementsOfCategory");
            PushButtonData pbdToolsFamilyMultipleSharedParameters = new PushButtonData("cmdToolsFamilyMultipleSharedParameters", "Shared\nParameters", AssemblyPath, "TorsionTools.Commands.FamilyMultipleSharedParameters");
            PushButtonData pbdToolsLinksReloadALl = new PushButtonData("cmdLinksReloadAll", "Reload\nLinks", AssemblyPath, "TorsionTools.Commands.LinksReloadAll");

            PushButtonData pbdMEPSpacesFromLinkedRooms = new PushButtonData("cmdMEPSpacesFromLinkedRooms", "Create\nSpaces", AssemblyPath, "TorsionTools.Commands.MEPSpacesFromRooms");

            //Create a Push Button from the Push Button Data
            PushButton pbTestButton = RibbonPanelOne.AddItem(pbdTestButton) as PushButton;

            PushButton pbSheetSelection          = RibbonPanelSheets.AddItem(pbdSheetSelection) as PushButton;
            PushButton pbSheetNameCapitalize     = RibbonPanelSheets.AddItem(pbdSheetNameCapitalize) as PushButton;
            PushButton pbSheetFindReplace        = RibbonPanelSheets.AddItem(pbdSheetFindReplace) as PushButton;
            PushButton pbSheetTitleblockKeyPlan  = RibbonPanelSheets.AddItem(pbdSheetTitleblockKeyPlan) as PushButton;
            PushButton pbSheetViewReferenceSheet = RibbonPanelSheets.AddItem(pbdSheetViewReferenceSheet) as PushButton;

            PushButton pbViewsFindReplace        = RibbonPanelViews.AddItem(pbdViewsFindReplace) as PushButton;
            PushButton pbViewsViewDeleteUnplaced = RibbonPanelViews.AddItem(pbdViewsViewDeleteUnplaced) as PushButton;
            PushButton pbViewActiveToSheet       = RibbonPanelViews.AddItem(pbdViewActiveToSheet) as PushButton;

            PushButton pbToolsWarnings       = RibbonPanelTools.AddItem(pbdToolsWarnings) as PushButton;
            PushButton pbToolsElemOfCategory = RibbonPanelTools.AddItem(pbdToolsElemOfCategory) as PushButton;
            PushButton pbToolsFamilyMultipleSharedParameters = RibbonPanelTools.AddItem(pbdToolsFamilyMultipleSharedParameters) as PushButton;
            PushButton pbToolsLinkReloadAll = RibbonPanelTools.AddItem(pbdToolsLinksReloadALl) as PushButton;

            PushButton pbMEPSpacesFromLinkedRooms = RibbonPanelMEP.AddItem(pbdMEPSpacesFromLinkedRooms) as PushButton;

            //If you are going to use PushButtonData objects for Pulldown or Split buttons, you have to set these properties BEFORE adding them
            pbdSheetLegendToMultiple.LargeImage   = ToolsSheetLegendMultipleImage;
            pbdSheetScheduleToMultiple.LargeImage = ToolsSheetScheduleMultipleImage;
            pbdSheetLegendToMultiple.ToolTip      = "Select a Legend Viewport to place on multiple sheets in the same location";
            pbdSheetScheduleToMultiple.ToolTip    = "Select a Schedule Instance to place on multiple sheets int he same location";

            pbdViewsLinkedViews.LargeImage           = ViewsLinkedViewsImage;
            pbdViewsLinkedViewsUpdate.LargeImage     = ViewsLinkedViewsUpdateImage;
            pbdViewsViewLegendCopy.LargeImage        = ViewsViewLegendCopyImage;
            pbdViewsViewScheduleCopy.LargeImage      = ViewsViewScheduleCopyImage;
            pbdViewsLinkedViews.ToolTip              = "Create Drafting Views based on Views in a Linked Model for reference";
            pbdViewsLinkedViewsUpdate.ToolTip        = "Update Linked View information referenced from a Linked Model";
            pbdViewsLinkedViews.LongDescription      = "Verify the current Revit Model has the following three parameters under Phasing paramter group and View category:\nLinked View - Yes/No\nLinked View GUID - Text\nLink Name - Text ";
            pbdViewsViewLegendCopy.ToolTip           = "Copy one or more Legend Views from a Linked Document";
            pbdViewsViewLegendCopy.LongDescription   = "Select the Linked Document from which you want to copy the Legend from. Then select from the available Legend views. Then press the Copy button to copy the Legends into the current Document.";
            pbdViewsViewScheduleCopy.ToolTip         = "Copy one or more Schedules form a Linked Document";
            pbdViewsViewScheduleCopy.LongDescription = "Select the Linked Document from which you want to copy the Schedule from. Then select from the available Schedules. Then press the Copy button to copy the Schedules into the current Document.";

            //Pull Down buttons allow you to stack similar or grouped buttons into a stack that you can expand down and select
            PulldownButtonData pdbdCopyLegendSchedule = new PulldownButtonData("pullDownCopyLegendSchedule", "Copy\nLegend");
            PulldownButton     pdbCopyLegendSchedule  = RibbonPanelViews.AddItem(pdbdCopyLegendSchedule) as PulldownButton;

            pdbCopyLegendSchedule.LargeImage = ViewsViewLegendCopyImage;
            pdbCopyLegendSchedule.AddPushButton(pbdViewsViewLegendCopy);
            pdbCopyLegendSchedule.AddPushButton(pbdViewsViewScheduleCopy);

            PulldownButtonData pdbdLinkedViews = new PulldownButtonData("pullDownLinkView", "Link\nViews");
            PulldownButton     pdbLinkedViews  = RibbonPanelViews.AddItem(pdbdLinkedViews) as PulldownButton;

            pdbLinkedViews.LargeImage = ViewsLinkedViewsImage;
            pdbLinkedViews.AddPushButton(pbdViewsLinkedViews);
            pdbLinkedViews.AddPushButton(pbdViewsLinkedViewsUpdate);

            PushButton pbViewsChangeViewReference = RibbonPanelViews.AddItem(pbdViewsChangeViewReference) as PushButton;

            PulldownButtonData pdbdPlaceMultipleLegendSchedule = new PulldownButtonData("pulldownPlaceMultipleLegendSchedule", "Place\nLegends");
            PulldownButton     pdbPlaceMultipleLegendSchedule  = RibbonPanelSheets.AddItem(pdbdPlaceMultipleLegendSchedule) as PulldownButton;

            pdbPlaceMultipleLegendSchedule.LargeImage = ToolsSheetLegendMultipleImage;
            pdbPlaceMultipleLegendSchedule.AddPushButton(pbdSheetLegendToMultiple);
            pdbPlaceMultipleLegendSchedule.AddPushButton(pbdSheetScheduleToMultiple);

            RadioButtonGroupData rbgdUpdaters  = new RadioButtonGroupData("UpdaterSettings");
            RadioButtonGroup     rdoBtnGroup   = RibbonPanelSettings.AddItem(rbgdUpdaters) as RadioButtonGroup;
            ToggleButtonData     tbdUpdaterOn  = new ToggleButtonData("cmdUpdaterOn", "Turn On\nDynamic\nUpdaters", AssemblyPath, "TorsionTools.Settings.UpdatersOn");
            ToggleButtonData     tbdUpdaterOff = new ToggleButtonData("cmdUpdaterOff", "Turn Off\nDynamic\nUpdaters", AssemblyPath, "TorsionTools.Settings.UpdatersOff");

            tbdUpdaterOn.ToolTip  = "Turn all Dynamic Model Updaters On";
            tbdUpdaterOff.ToolTip = "Turn all Dynamic Model Updaters Off";

            rdoBtnGroup.AddItem(tbdUpdaterOn);
            rdoBtnGroup.AddItem(tbdUpdaterOff);

            //Set Button Image
            pbTestButton.LargeImage = ButtonImage;

            pbSheetNameCapitalize.LargeImage     = SheetCapitalizeImage;
            pbSheetFindReplace.LargeImage        = FindReplaceImage;
            pbSheetSelection.LargeImage          = SheetSelectionImage;
            pbSheetTitleblockKeyPlan.LargeImage  = SheetTitleblockKeyPlanImage;
            pbSheetViewReferenceSheet.LargeImage = SheetViewRefSheetImage;

            pbViewsFindReplace.LargeImage         = FindReplaceImage;
            pbViewsViewDeleteUnplaced.LargeImage  = ViewsViewDeleteunplacedImage;
            pbViewActiveToSheet.LargeImage        = SquareTImage;
            pbViewsChangeViewReference.LargeImage = ViewsChangeViewReferenceImage;

            pbToolsWarnings.LargeImage       = ToolsWarningsImage;
            pbToolsElemOfCategory.LargeImage = ToolsElemOfCategoryImage;
            pbToolsFamilyMultipleSharedParameters.LargeImage = ToolsFamilyMultipleSharedParametersImage;
            pbToolsLinkReloadAll.LargeImage = SquareTImage;

            pbMEPSpacesFromLinkedRooms.LargeImage = MEPSpacesFromLinkedRoomsImage;

            //Set Button Tool Tips
            pbTestButton.ToolTip              = "Tell the user what your button does here";
            pbSheetSelection.ToolTip          = "Select from all of the Sheets in the Model";
            pbSheetFindReplace.ToolTip        = "Find and Replace values in Sheet Name or Number";
            pbSheetNameCapitalize.ToolTip     = "Capitalize the Name of all Sheets in the Model";
            pbSheetTitleblockKeyPlan.ToolTip  = "Set Yes / No parameters of a Titleblock type based on search criteria of the Sheet Name or Sheet Number";
            pbSheetViewReferenceSheet.ToolTip = "Select a Viewport on a sheet to open the Refering Sheet for the associated View";

            pbViewsFindReplace.ToolTip         = "Find and Replace values in View Name or Title on Sheet";
            pbViewsViewDeleteUnplaced.ToolTip  = "Delete Views, View Templates, Schedules, and Legends that are not used";
            pbViewsChangeViewReference.ToolTip = "Change the Reference for all views that currently reference a different View";
            pbViewActiveToSheet.ToolTip        = "Place the Active View on the selected Sheet";

            pbToolsWarnings.ToolTip       = "Display and isolate Warnings in the Document";
            pbToolsElemOfCategory.ToolTip = "Get all Elements of selected Category";
            pbToolsFamilyMultipleSharedParameters.ToolTip = "Add the selected Shared Parameters in all Revit Families within the selected Directory";
            pbToolsLinkReloadAll.ToolTip = "Reload all Revit Links that are currently loaded";

            pbMEPSpacesFromLinkedRooms.ToolTip = "Create MEP Spaces for the Selected Rooms from a Linked Model";

            //Set Button Long description which is the text that flys out when you hover on a button longer
            pbTestButton.LongDescription     = "Give the user more information about how they need to use the button features";
            pbSheetSelection.LongDescription = "The Sheet Selection Form can be used in multiple ways to allow the user to select one or multiple sheets in the project and perform additiona actions on the sheets returned.";
        }
Ejemplo n.º 10
0
    /// <summary>
    /// Control buttons for Event and Dynamic Model Update 
    /// </summary>
    public void AddUILabsCommandButtons2(RibbonPanel panel)
    {
      // Get the location of this dll. 
      string assembly = GetType().Assembly.Location;

      // Create three toggle buttons for radio button group 
      // #1 
      ToggleButtonData toggleButtonData1 = new ToggleButtonData("UILabsEventOn", "Event" + "\n Off", assembly, _uiLabName + ".UIEventOff");
      toggleButtonData1.LargeImage = NewBitmapImage("Basics.ico");

      // #2 
      ToggleButtonData toggleButtonData2 = new ToggleButtonData("UILabsEventOff", "Event" + "\n On", assembly, _uiLabName + ".UIEventOn");
      toggleButtonData2.LargeImage = NewBitmapImage("Basics.ico");

      // Create three toggle buttons for radio button group 
      // #3 
      ToggleButtonData toggleButtonData3 = new ToggleButtonData("UILabsDynUpdateOn", "Center" + "\n Off", assembly, _uiLabName + ".UIDynamicModelUpdateOff");
      toggleButtonData3.LargeImage = NewBitmapImage("Families.ico");

      // #4 
      ToggleButtonData toggleButtonData4 = new ToggleButtonData("UILabsDynUpdateOff", "Center" + "\n On", assembly, _uiLabName + ".UIDynamicModelUpdateOn");
      toggleButtonData4.LargeImage = NewBitmapImage("Families.ico");

      // Make event pn/off radio button group 
      RadioButtonGroupData radioBtnGroupData1 = new RadioButtonGroupData("EventNotification");
      RadioButtonGroup radioBtnGroup1 = panel.AddItem(radioBtnGroupData1) as RadioButtonGroup;
      radioBtnGroup1.AddItem(toggleButtonData1);
      radioBtnGroup1.AddItem(toggleButtonData2);

      // Make dyn update on/off radio button group 
      RadioButtonGroupData radioBtnGroupData2 = new RadioButtonGroupData("WindowDoorCenter");
      RadioButtonGroup radioBtnGroup2 = panel.AddItem(radioBtnGroupData2) as RadioButtonGroup;
      radioBtnGroup2.AddItem(toggleButtonData3);

      radioBtnGroup2.AddItem(toggleButtonData4);
    }
Ejemplo n.º 11
0
    /// <summary>
    /// Radio/toggle button for "Command Data", "DB Element" and "Element Filtering"
    /// </summary>
    public void AddRadioButton(RibbonPanel panel)
    {
      // Create three toggle buttons for radio button group 

      // #1 
      ToggleButtonData toggleButtonData1 = new ToggleButtonData("RadioCommandData", "Command" + "\n Data", _introLabPath, _introLabName + ".CommandData");
      toggleButtonData1.LargeImage = NewBitmapImage("Basics.ico");

      // #2 
      ToggleButtonData toggleButtonData2 = new ToggleButtonData("RadioDbElement", "DB" + "\n Element", _introLabPath, _introLabName + ".DBElement");
      toggleButtonData2.LargeImage = NewBitmapImage("Basics.ico");

      // #3 
      ToggleButtonData toggleButtonData3 = new ToggleButtonData("RadioElementFiltering", "Filtering", _introLabPath, _introLabName + ".ElementFiltering");
      toggleButtonData3.LargeImage = NewBitmapImage("Basics.ico");

      // Make a radio button group now 
      RadioButtonGroupData radioBtnGroupData = new RadioButtonGroupData("RadioButton");
      RadioButtonGroup radioBtnGroup = panel.AddItem(radioBtnGroupData) as RadioButtonGroup;
      radioBtnGroup.AddItem(toggleButtonData1);
      radioBtnGroup.AddItem(toggleButtonData2);
      radioBtnGroup.AddItem(toggleButtonData3);
    }
Ejemplo n.º 12
0
        public void Add_WTA_FP_Ribbon(UIControlledApplication a)
        {
            string ExecutingAssemblyPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
            string ExecutingAssemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
            // create ribbon tab
            String thisTabNameFP = "WTA-FP";

            try {
                a.CreateRibbonTab(thisTabNameFP);
            } catch (Autodesk.Revit.Exceptions.ArgumentException) {
                // Assume error generated is due to "WTA" already existing
            }

            #region Add ribbon panels.
            //   Add ribbon panels.
            String      thisPanelNamBe    = "Be This";
            RibbonPanel thisRibbonPanelBe = a.CreateRibbonPanel(thisTabNameFP, thisPanelNamBe);

            String      thisPanelNameSprinklers   = "Sprinklers";
            RibbonPanel thisRibbonPanelSprinklers = a.CreateRibbonPanel(thisTabNameFP, thisPanelNameSprinklers);

            String      thisPanelNameAiming   = "3d Aiming";
            RibbonPanel thisRibbonPanelAiming = a.CreateRibbonPanel(thisTabNameFP, thisPanelNameAiming);
            #endregion

            ///Note that the full image name is namespace_prefix + "." + the actual imageName);
            ///pushButton.LargeImage = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), "PlunkOMaticTCOM.QVis.png");

            //   Create push button in this ribbon panel
            PushButtonData pbDataSprnkConc = new PushButtonData("SprnkConc", "Concealed", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdPlaceConcealedSprinklerInstance");
            PushButtonData pbDataSprnkRec  = new PushButtonData("SprnkRec", "Recessed", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdPlaceRecessedSprinklerInstance");
            PushButtonData pbDataSprnkPend = new PushButtonData("SprnkPend", "Pendent", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdPlacePendentSprinklerInstance");
            PushButtonData pbDataSprnkUp   = new PushButtonData("SprnkUp", "Upright", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdPlaceUprightSprinklerInstance");
            PushButtonData pbDataOppArray  = new PushButtonData("OppArray", "Design Array", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdPlaceSprinklerArrayTool");
            PushButtonData pbDataOppArea   = new PushButtonData("OppArea", "Oper Area", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdPlaceSprinklerOperAreaTool");

            PushButtonData pbDataSelectOnlySprink = new PushButtonData("SelSprnk", "PickOnly", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdPickSprinksOnly");

            PushButtonData pbDataSetSprinkOps = new PushButtonData("SprnkOps", "Sprnk Ops", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdResetThisSprnkOps");
            pbDataSetSprinkOps.ToolTip = "Set design tool sprinkler spacing data.";
            string lDescDT = "The Design Array and Oper Area layout tool families take parameters";
            lDescDT += " that control the sprinkler operation area, spacing and array sizes. Those";
            lDescDT += " parameters can be set ahead of time as a persistent user settings so that";
            lDescDT += " it is not necessary to use the Revit properties setter to affect the desired values.";
            lDescDT += " The Sprnk Ops tool sets those values and allows you to apply them to a pick.";
            pbDataSetSprinkOps.LongDescription = lDescDT;
            pbDataSetSprinkOps.LargeImage      = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".SprnkOps.png");
            pbDataSetSprinkOps.ToolTipImage    = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".SetOpArea.PNG");


            PushButtonData pbBeFP = new PushButtonData("BeFP", "FireP", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdBeFPWorkSet");
            pbBeFP.ToolTip = "Switch to Fire Protection Workset.";
            string lDescBeFP = "If you can't beat'm, join'm. Become FIRE PROTECTION workset.";
            pbBeFP.LongDescription = lDescBeFP;

            //   Set the large image shown on button
            //Note that the full image name is namespace_prefix + "." + the actual imageName);
            pbDataSprnkUp.Image   = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".Upright.png");
            pbDataSprnkConc.Image = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".Concealed.png");
            pbDataSprnkPend.Image = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".Pendent.png");
            pbDataSprnkRec.Image  = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".Recessed.png");
            pbDataOppArea.Image   = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".OpArea.png");
            pbDataOppArray.Image  = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".OpArray.png");

            pbDataSelectOnlySprink.Image      = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".PickOnlySprnk16x16.png");
            pbDataSelectOnlySprink.LargeImage = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".PickOnlySprnk32x32.png");


            // add button tips (when data, must be defined prior to adding button.)
            pbDataSprnkConc.ToolTip = "Concealed Sprinkler";
            pbDataSprnkRec.ToolTip  = "Recessed Sprinkler";
            pbDataSprnkPend.ToolTip = "Pendent Sprinkler";
            pbDataSprnkUp.ToolTip   = "Upright Sprinkler";
            pbDataOppArea.ToolTip   = "Operation Area Tool";
            pbDataOppArray.ToolTip  = "Array Design Tool";

            pbDataSelectOnlySprink.ToolTip = "Pick Only Sprinklers";

            string lDesc          = "Places a sprinkler at the ceiling elevation set by picking a ceiling (if prompted).\n\n\u00A7 Workset will be FIRE PROTECTION.";
            string lDescTool      = "Places a sprinkler design tool at the ceiling elevation set by picking a ceiling.\n\n\u00A7 Workset will be FIRE PROTECTION.";
            string lDescPickOnlyS = "Swipe over anything. Only sprinklers are selected.";

            pbDataSprnkConc.LongDescription = lDesc;
            pbDataSprnkRec.LongDescription  = lDesc;
            pbDataSprnkPend.LongDescription = lDesc;
            pbDataSprnkUp.LongDescription   = lDesc;
            pbDataOppArray.LongDescription  = lDescTool;
            pbDataOppArea.LongDescription   = lDescTool;

            pbDataSelectOnlySprink.LongDescription = lDescPickOnlyS;

            RadioButtonGroupData rbgdSTD_EC = new RadioButtonGroupData("rbgdSTD_EC");
            RadioButtonGroup     rbgSTD_EC  = thisRibbonPanelSprinklers.AddItem(rbgdSTD_EC) as RadioButtonGroup;
            ToggleButtonData     tbSTD      = new ToggleButtonData("tbSTD", " STD ",
                                                                   ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdSetAs_STD");
            ToggleButtonData tbEC = new ToggleButtonData("tbEC", " EC ",
                                                         ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdSetAs_EC");
            tbSTD.ToolTip    = "Standard Coverage \nsprinklers will be placed.";
            tbEC.ToolTip     = "Extended Coverage \nsprinklers will be placed.";
            tbEC.LargeImage  = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".bt_EC.png");
            tbSTD.LargeImage = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".bt_STD.png");
            rbgSTD_EC.AddItem(tbSTD);
            rbgSTD_EC.AddItem(tbEC);

            // Not working
            //pbDataToggle_STD_EC = new PushButtonData("togbutdata_TOG_STD_EC", "STD/EC", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdTogState_STD_EC");
            //pbDataToggle_STD_EC.ToolTip = "Standard Coverage/Extended Coverage";  // undetermined at this point
            //pbDataToggle_STD_EC.LargeImage = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".bt_STD24x24.png");
            //PushButton pushbutdata_TOG_STD_EC = thisNewRibbonPanel.AddItem(pbDataToggle_STD_EC) as PushButton;

            PushButtonData b1x1 = new PushButtonData("OSET_1x1", "1x1", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdSetOffsetState1x1");
            PushButtonData b2x1 = new PushButtonData("OSET_2x1", "2x1", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdSetOffsetState2x1");
            PushButtonData b3x1 = new PushButtonData("OSET_3x1", "3x1", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdSetOffsetState3x1");
            PushButtonData b1x2 = new PushButtonData("OSET_1x2", "1x2", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdSetOffsetState1x2");
            PushButtonData b1x3 = new PushButtonData("OSET_1x3", "1x3", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdSetOffsetState1x3");
            PushButtonData b0x0 = new PushButtonData("OSET_0x0", "0x0", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdSetOffsetState0x0");

            b1x1.LargeImage = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".B1x1.png");
            b2x1.LargeImage = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".B2x1.png");
            b3x1.LargeImage = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".B3x1.png");
            b1x2.LargeImage = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".B1x2.png");
            b1x3.LargeImage = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".B1x3.png");
            b0x0.LargeImage = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".B0x0.png");

            b1x1.ToolTip = "Item placement will be offset\n" +
                           "1' by 1' from the pick point.\n" +
                           "Think lay-in ceiling tile.";
            b2x1.ToolTip = "Item placement will be offset\n" +
                           "2' by 1' from the pick point.\n" +
                           "Think lay-in ceiling tile.";
            b3x1.ToolTip = "Item placement will be offset\n" +
                           "3' by 1' from the pick point.\n" +
                           "Think lay-in ceiling tile.";
            b1x2.ToolTip = "Item placement will be offset\n" +
                           "1' by 2' from the pick point.\n" +
                           "Think lay-in ceiling tile.";
            b1x3.ToolTip = "Item placement will be offset\n" +
                           "1' by 3' from the pick point.\n" +
                           "Think lay-in ceiling tile.";
            b0x0.ToolTip = "Item placement will be at the\n" +
                           "pick point.";

            SplitButtonData sbOffSetData = new SplitButtonData("splitOffSets", "Loc");
            SplitButton     sbOffSet     = thisRibbonPanelSprinklers.AddItem(sbOffSetData) as SplitButton;
            sbOffSet.AddPushButton(b1x1);
            sbOffSet.AddPushButton(b2x1);
            sbOffSet.AddPushButton(b3x1);
            sbOffSet.AddPushButton(b1x2);
            sbOffSet.AddPushButton(b1x3);
            sbOffSet.AddPushButton(b0x0);


            #region 3dAiming
            PushButtonData pbReset3dAiming  = new PushButtonData("Reset3dAim", "Reset 3D Aiming", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdAimResetRotateOne3DMany");
            PushButtonData pbSingle3dAiming = new PushButtonData("Single3DAim", "Single 3D Aim", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdSprinkRot3D");
            PushButtonData pbMany3dAiming   = new PushButtonData("Many3dAim", "Many 3D Aim", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdSprinkRot3DMany");

            pbReset3dAiming.ToolTip = "Reset 3D aimed objects\n" +
                                      "to zero state.";
            pbSingle3dAiming.ToolTip = "3D aim a single object\n" +
                                       "to a target point.";
            pbMany3dAiming.ToolTip = "3D aim multiple objects\n" +
                                     "to the same target point.";
            #endregion

            // add to ribbon panelA
            // List<RibbonItem> projectButtonsBe = new List<RibbonItem>();
            // projectButtonsBe.AddRange(thisRibbonPanelBe.AddStackedItems(pbBeFP, another etc));
            thisRibbonPanelBe.AddItem(pbBeFP);

            // add to ribbon panel
            List <RibbonItem> sprnkButtons = new List <RibbonItem>();
            sprnkButtons.AddRange(thisRibbonPanelSprinklers.AddStackedItems(pbDataSprnkConc, pbDataSprnkRec, pbDataSprnkPend));
            sprnkButtons.AddRange(thisRibbonPanelSprinklers.AddStackedItems(pbDataSprnkUp, pbDataOppArray, pbDataOppArea));

            thisRibbonPanelSprinklers.AddSeparator();
            PushButton pushButtonSprnkOps = thisRibbonPanelSprinklers.AddItem(pbDataSetSprinkOps) as PushButton;

            thisRibbonPanelSprinklers.AddSeparator();
            PushButton pushButtonSelSprnk = thisRibbonPanelSprinklers.AddItem(pbDataSelectOnlySprink) as PushButton;

            // This is to another panel. No separator needed.
            List <RibbonItem> aimerButtons = new List <RibbonItem>();
            aimerButtons.AddRange(thisRibbonPanelAiming.AddStackedItems(pbSingle3dAiming, pbMany3dAiming, pbReset3dAiming));

            /// Anything added after slideout it declared can only be in the slideout
            thisRibbonPanelBe.AddSlideOut();
            PushButtonData bInfo = new PushButtonData("Info", "Info", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdOpenDocFolder");
            bInfo.ToolTip    = "See the help document regarding this.";
            bInfo.LargeImage = NewBitmapImage(System.Reflection.Assembly.GetExecutingAssembly(), ExecutingAssemblyName + ".InfoLg.png");
            thisRibbonPanelBe.AddItem(bInfo);
            thisRibbonPanelSprinklers.AddSlideOut();
            thisRibbonPanelSprinklers.AddItem(bInfo);
        } // AddRibbon
Ejemplo n.º 13
0
        public Result OnStartup(UIControlledApplication a)
        {
            _mMyForm = null; // no dialog needed yet; the command will bring it
            ThisApp  = this; // static access to this application instance

            BrickDimUpdater updater = new BrickDimUpdater(a.ActiveAddInId);

            Debug.Print("register");
            UpdaterRegistry.RegisterUpdater(updater);
            ElementCategoryFilter f = new ElementCategoryFilter(BuiltInCategory.OST_Dimensions);

            Debug.Print("filter");
            UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), f, Element.GetChangeTypeAny());


            // Method to add Tab and Panel
            RibbonPanel panel = RibbonPanel(a);

            string thisAssemblyPath = Assembly.GetExecutingAssembly().Location;

            // BUTTON FOR COLOURING DIMENSIONS
            if (panel.AddItem(
                    new PushButtonData("Colour", "Colour\nIn View", thisAssemblyPath,
                                       "BrickDims.BrickDimsColourOverride")) is PushButton button2)
            {
                button2.ToolTip = "Visual interface for debugging applications.";
                Uri         uriImageB2   = new Uri("pack://application:,,,/BrickDims;component/Resources/brick-Rainbow.png");
                BitmapImage largeImageB2 = new BitmapImage(uriImageB2);
                button2.LargeImage = largeImageB2;
            }

            //panel.AddSeparator();

            /// <summary>
            /// Control buttons for the Dynamic Model Update
            /// </summary>
            ToggleButtonData toggleButtonData3
                = new ToggleButtonData("UpdaterStoptxtOff", "Stop\nAuto", thisAssemblyPath, "BrickDims.UIDynamicModelUpdateOff");
            Uri         uriImageTB3   = new Uri("pack://application:,,,/BrickDims;component/Resources/stop-big.png");
            BitmapImage largeImageTB3 = new BitmapImage(uriImageTB3);

            toggleButtonData3.LargeImage = largeImageTB3;


            ToggleButtonData toggleButtonData4
                = new ToggleButtonData("UpdaterPlaytxtOff", "Start\nAuto", thisAssemblyPath, "BrickDims.UIDynamicModelUpdateOn");
            Uri         uriImageTB4   = new Uri("pack://application:,,,/BrickDims;component/Resources/play-big.png");
            BitmapImage largeImageTB4 = new BitmapImage(uriImageTB4);

            toggleButtonData4.LargeImage = largeImageTB4;

            //TextBoxData brkDimTxt = new TextBoxData("Pause Play Updater");

            //panel.AddItem(toggleButtonData3);
            //panel.AddItem(toggleButtonData4);

            // make dyn update on/off radio button group

            RadioButtonGroupData radioBtnGroupData2 = new RadioButtonGroupData("Updater");

            //IList<RibbonItem> stackedGroup1 = panel.AddStackedItems(toggleButtonData4, toggleButtonData3);
            //as RadioButtonGroup;
            RadioButtonGroup radioBtnGroup2 = panel.AddItem(radioBtnGroupData2) as RadioButtonGroup;

            radioBtnGroup2.AddItem(toggleButtonData3);
            radioBtnGroup2.AddItem(toggleButtonData4);


            // listeners/watchers for external events (if you choose to use them)
            a.ApplicationClosing += a_ApplicationClosing; //Set Application to Idling
            a.Idling             += a_Idling;

            //turn off text in buttons where we want it
            setButtonNoText();

            panel.AddSeparator();

            // BUTTON FOR THE SINGLE-THREADED WPF OPTION
            if (panel.AddItem(
                    new PushButtonData("Brick Dim Selector", "Selector", thisAssemblyPath,
                                       "BrickDims.EntryCommand")) is PushButton button)
            {
                // defines the tooltip displayed when the button is hovered over in Revit's ribbon
                button.ToolTip = "Visual interface for debugging applications.";
                // defines the icon for the button in Revit's ribbon - note the string formatting
                Uri         uriImageB1   = new Uri("pack://application:,,,/BrickDims;component/Resources/brick-Small.png");
                BitmapImage largeImageB1 = new BitmapImage(uriImageB1);
                button.LargeImage = largeImageB1;
            }

            return(Result.Succeeded);
        }
Ejemplo n.º 14
0
        private void SetupUI(UIControlledApplication application)
        {
            RibbonPanel panel = application.CreateRibbonPanel("STL import");

            PushButtonData stlImportButton = new PushButtonData("StlImport", "Import STL file",
                                                                addinAssemblyPath, typeof(StlImport.StlImportCommand).FullName);
            PushButton button = panel.AddItem(stlImportButton) as PushButton;

            //SetIconsForPushButton(button, StlImport.Properties.Resources.StrcturalWall);

            panel = application.CreateRibbonPanel("STL import properties");

            RadioButtonGroupData radioGroupData = new RadioButtonGroupData("Mode");
            RadioButtonGroup     radioGroup     = panel.AddItem(radioGroupData) as RadioButtonGroup;

            ToggleButtonData solidButton = new ToggleButtonData("SetModeToSolid", "Solid",
                                                                addinAssemblyPath, typeof(StlImport.SetToSolidCommand).FullName);
            ToggleButton solid = radioGroup.AddItem(solidButton);

            /*
             * ToggleButtonData anyGeometryButton = new ToggleButtonData("SetModeToAnyGeometry", "Any Geometry",
             * addinAssemblyPath, typeof(StlImport.SetToAnyGeometryCommand).FullName);
             * ToggleButton anyGeometry = radioGroup.AddItem(anyGeometryButton) as ToggleButton;
             */
            ToggleButtonData polymeshButton = new ToggleButtonData("SetModeToPolymesh", "Polymesh",
                                                                   addinAssemblyPath, typeof(StlImport.SetToPolymeshCommand).FullName);

            radioGroup.AddItem(polymeshButton);

            radioGroup.Current = solid;

            panel.AddSeparator();

            radioGroupData = new RadioButtonGroupData("Style");
            radioGroup     = panel.AddItem(radioGroupData) as RadioButtonGroup;

            ToggleButtonData noneButton = new ToggleButtonData("SetStyleToNone", "None",
                                                               addinAssemblyPath, typeof(StlImport.SetStyleToNoneCommand).FullName);

            radioGroup.AddItem(noneButton);

            ToggleButtonData sketchStyleButton = new ToggleButtonData("SetStyleToSketch", "Sketch",
                                                                      addinAssemblyPath, typeof(StlImport.SetStyleToSketchCommand).FullName);

            radioGroup.AddItem(sketchStyleButton);

            panel.AddSeparator();

            radioGroupData = new RadioButtonGroupData("DataType");
            radioGroup     = panel.AddItem(radioGroupData) as RadioButtonGroup;

            ToggleButtonData binaryButton = new ToggleButtonData("SetDataTypeToBinary", "Binary",
                                                                 addinAssemblyPath, typeof(StlImport.SetDataTypeToBinaryCommand).FullName);

            radioGroup.AddItem(binaryButton);

            ToggleButtonData asciiButton = new ToggleButtonData("SetDataTypeToASCII", "ASCII",
                                                                addinAssemblyPath, typeof(StlImport.SetDataTypeToASCIICommand).FullName);

            radioGroup.AddItem(asciiButton);
        }
Ejemplo n.º 15
0
        public Result OnStartup(UIControlledApplication a)
        {
            //Allow for the folderpath to connect dll file as well as images
            //Do this for efficiency
            string folderPath = @"C:\Samples\CustomTabRibbon\CustomTabRibbon\bin\Debug";
            string dll        = Path.Combine(folderPath, "CustomTabRibbon.dll");

            //Create Custom Tab
            string TheRibbon = "Custom TAB";

            a.CreateRibbonTab(TheRibbon);

            //Create Seperated Panels
            RibbonPanel panelA = a.CreateRibbonPanel(TheRibbon, "A");
            RibbonPanel panelB = a.CreateRibbonPanel(TheRibbon, "B");
            RibbonPanel panelC = a.CreateRibbonPanel(TheRibbon, "C");
            RibbonPanel panelD = a.CreateRibbonPanel(TheRibbon, "D");
            RibbonPanel panelE = a.CreateRibbonPanel(TheRibbon, "E");
            RibbonPanel panelF = a.CreateRibbonPanel(TheRibbon, "F");


/////////////
            //STANDARD BUTTONS One and Two on Panel A
/////////////
            //--LargeImage--32x32 image seen in panel
            //--Image--16x16 when added to quick access tool bar
            //--ToolTipImage-- unknown png size
            PushButton btnOne = (PushButton)panelA.AddItem(new PushButtonData("One", "One", dll, "CustomTabRibbon.One"));
            //btnOne.LargeImage = new BitmapImage(new Uri(Path.Combine(folderPath, "image32.png"), UriKind.Absolute));
            Uri         uriImage   = new Uri(@"C:\Samples\CustomTabRibbon\CustomTabRibbon\bin\Debug\32Groot.png");
            BitmapImage largeImage = new BitmapImage(uriImage);

            btnOne.LargeImage      = largeImage; //Actually attaches image to button one - panel A
            btnOne.ToolTip         = "This is a tool tip!";
            btnOne.LongDescription = "This is a lonnnnnnnnnnnnng description!";

            PushButton  btnTwo      = (PushButton)panelA.AddItem(new PushButtonData("Two", "Two", dll, "CustomTabRibbon.Two"));
            Uri         uriImage2   = new Uri(@"C:\Samples\CustomTabRibbon\CustomTabRibbon\bin\Debug\32Hacker.png");
            BitmapImage largeImage2 = new BitmapImage(uriImage2);

            btnTwo.LargeImage      = largeImage2;
            btnTwo.ToolTip         = "This is a tool tip!";
            btnTwo.LongDescription = "This is a lonnnnnnnnnnnnng description!";

            PushButton  btnThree     = (PushButton)panelA.AddItem(new PushButtonData("Three", "Three", dll, "CustomTabRibbon.Two"));
            Uri         uriImage11   = new Uri(@"C:\Samples\CustomTabRibbon\CustomTabRibbon\bin\Debug\32Ironman.png");
            BitmapImage largeImage11 = new BitmapImage(uriImage11);

            btnThree.LargeImage      = largeImage11;
            btnThree.ToolTip         = "This is a tool tip!";
            btnThree.LongDescription = "This is a lonnnnnnnnnnnnng description!";

/////////////
            //PULLDOWN LIST
/////////////
            PulldownButtonData pullDownData   = new PulldownButtonData("My PullDown", "My PullDown");
            PulldownButton     pullDownButton = panelB.AddItem(pullDownData) as PulldownButton;

            pullDownButton.LargeImage = new BitmapImage(new Uri(Path.Combine(folderPath, "24Penguin.png"), UriKind.Absolute));

//            Uri uriImage3 = new Uri(@"C:\Samples\AddPanel\AddPanel\bin\Debug\hacker_icon.png");
//            BitmapImage largeImage3 = new BitmapImage(uriImage3);
//            pullDownButton.LargeImage = largeImage3;

            PushButton btnTagAllByCategory  = pullDownButton.AddPushButton(new PushButtonData("One", "Item One", dll, "CustomTabRibbon.One"));
            PushButton btnTagAllBySelection = pullDownButton.AddPushButton(new PushButtonData("Two", "Item Two", dll, "CustomTabRibbon.Two"));
            PushButton btnTagAllByFamily    = pullDownButton.AddPushButton(new PushButtonData("Three", "Item Three", dll, "CustomTabRibbon.Three"));

/////////////
            //STACKED LIST
/////////////
            PushButtonData dataHelp     = new PushButtonData("Help", "Help", dll, "CustomTabRibbon.help");
            PushButtonData dataAbout    = new PushButtonData("About", "About", dll, "CustomTabRibbon.about");
            PushButtonData dataFeedback = new PushButtonData("Feedback", "Feedback", dll, "CustomTabRibbon.feedback");

            IList <RibbonItem> stackedList = panelC.AddStackedItems(dataHelp, dataAbout, dataFeedback);

            PushButton btnHelp = (PushButton)stackedList[0];

            btnHelp.Image = new BitmapImage(new Uri(Path.Combine(folderPath, "16Smileface.png"), UriKind.Absolute));
//            Uri uriImage4 = new Uri(@"C:\Samples\AddPanel\AddPanel\bin\Debug\hacker_icon.png");
//            BitmapImage largeImage4 = new BitmapImage(uriImage4);
//            btnHelp.LargeImage = largeImage4;
//            BitmapImage smallImage = new BitmapImage(uriImage4);
//            btnHelp.Image = smallImage;
            btnHelp.ToolTip = "Click for help!";

            PushButton btnAbout = (PushButton)stackedList[1];

            btnAbout.Image = new BitmapImage(new Uri(Path.Combine(folderPath, "16Snapghost.png"), UriKind.Absolute));
//            Uri uriImage5 = new Uri(@"C:\Samples\AddPanel\AddPanel\bin\Debug\hacker_icon.png");
//            BitmapImage largeImage5 = new BitmapImage(uriImage5);
//            btnAbout.LargeImage = largeImage5;
//            BitmapImage smallImage = new BitmapImage(uriImage4);
//            btnHelp.Image = smallImage;
            btnAbout.ToolTip = "About these tools";

            PushButton btnFeedback = (PushButton)stackedList[2];

            btnFeedback.Image = new BitmapImage(new Uri(Path.Combine(folderPath, "16Tesseract.png"), UriKind.Absolute));
//            Uri uriImage6 = new Uri(@"C:\Samples\AddPanel\AddPanel\bin\Debug\hacker_icon.png");
//            BitmapImage largeImage6 = new BitmapImage(uriImage6);
//            btnFeedback.LargeImage = largeImage6;
//            BitmapImage smallImage = new BitmapImage(uriImage4);
//            btnHelp.Image = smallImage;
            btnFeedback.ToolTip = "Want some feedback?";


/////////////
            //RADIO BUTTONS
/////////////
            RadioButtonGroupData radioData        = new RadioButtonGroupData("radioGroup");
            RadioButtonGroup     radioButtonGroup = panelD.AddItem(radioData) as RadioButtonGroup;

            // create toggle buttons and add to radio button group
            ToggleButtonData tb1 = new ToggleButtonData("toggleButton1", "Red");

            tb1.ToolTip    = "Red Option";
            tb1.LargeImage = new BitmapImage(new Uri(@"C:\Samples\CustomTabRibbon\CustomTabRibbon\bin\Debug\24red.png"));

            ToggleButtonData tb2 = new ToggleButtonData("toggleButton2", "Green");

            tb2.ToolTip    = "Green Option";
            tb2.LargeImage = new BitmapImage(new Uri(@"C:\Samples\CustomTabRibbon\CustomTabRibbon\bin\Debug\24green.png"));

            ToggleButtonData tb3 = new ToggleButtonData("toggleButton3", "Yellow");

            tb3.ToolTip    = "Yellow Option";
            tb3.LargeImage = new BitmapImage(new Uri(@"C:\Samples\CustomTabRibbon\CustomTabRibbon\bin\Debug\24yellow.png"));

            radioButtonGroup.AddItem(tb1);
            radioButtonGroup.AddItem(tb2);
            radioButtonGroup.AddItem(tb3);

/////////////
            //SPLIT BUTTON
/////////////
            string assembly = @"C:\Samples\CustomTabRibbon\CustomTabRibbon\bin\Debug\CustomTabRibbon.dll";

            // create push buttons for split button drop down
            PushButtonData bOne = new PushButtonData("ButtonNameA", "Option One", assembly, "CustomTabRibbon.One");

            bOne.LargeImage = new BitmapImage(new Uri(@"C:\Samples\CustomTabRibbon\CustomTabRibbon\bin\Debug\8One.png"));

            PushButtonData bTwo = new PushButtonData("ButtonNameB", "Option Two", assembly, "CustomTabRibbon.Two");

            bTwo.LargeImage = new BitmapImage(new Uri(@"C:\Samples\CustomTabRibbon\CustomTabRibbon\bin\Debug\8one.png"));

            PushButtonData bThree = new PushButtonData("ButtonNameC", "Option Three", assembly, "CustomTabRibbon.Three");

            bThree.LargeImage = new BitmapImage(new Uri(@"C:\Samples\CustomTabRibbon\CustomTabRibbon\bin\Debug\8one.png"));

            SplitButtonData sb1 = new SplitButtonData("splitButton1", "Split");
            SplitButton     sb  = panelE.AddItem(sb1) as SplitButton;

            sb.AddPushButton(bOne);
            sb.AddPushButton(bTwo);
            sb.AddPushButton(bThree);

/////////////
            //Search
/////////////
            //PushButton btnFive = (PushButton)panelF.AddItem(new PushButtonData("Five", "Five", dll, "CustomTabRibbon.SelectFilterWalls"));


            return(Result.Succeeded);
        }