public void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBoxData data_add = null; ComboBoxData data_remove; if (e.AddedItems.Count > 0) { data_add = e.AddedItems[0] as ComboBoxData; if (data_add != null) { if (data_add.Node == managerexplorernodes.NodeWorking()) { return; } } } if (e.RemovedItems.Count > 0 && data_add != null) { data_remove = e.RemovedItems[0] as ComboBoxData; if (data_remove != null) { if (data_remove.Node == managerexplorernodes.NodeWorking()) { managerexplorernodes.Next(data_add.Node); ExplorerCurrentNode(); } } } }
/// <summary> /// Class Constructor /// </summary> public HisCardRecordsForm(DeviceInfo dev) { InitializeComponent(); ComboEntity = new ComboBoxData(); CurRecords = new List <CardRecordInfo>(); CurDev = dev; }
public static void CreateUI(RibbonPanel ribbonPanel) { // Create a push button to trigger a command add it to the ribbon panel. var thisAssembly = Assembly.GetExecutingAssembly(); var buttonData = new PushButtonData ( "cmdRhinoInsideSample4", "Sample 4", thisAssembly.Location, MethodBase.GetCurrentMethod().DeclaringType.FullName ); var comboBoxData = new ComboBoxData("Category") { ToolTip = "Category where Sample 4 will place geometry." }; var items = ribbonPanel.AddStackedItems(buttonData, comboBoxData); if (items[0] is PushButton pushButton) { pushButton.ToolTip = "Eval a Grasshopper definition"; pushButton.LargeImage = ImageBuilder.BuildImage("4"); pushButton.SetContextualHelp(new ContextualHelp(ContextualHelpType.Url, "https://github.com/mcneel/rhino.inside/blob/master/Autodesk/Revit/README.md#sample-4")); } categoriesComboBox = items[1] as Autodesk.Revit.UI.ComboBox; Revit.ApplicationUI.ViewActivated += ActiveUIApplication_ViewActivated; }
public Result OnStartup(UIControlledApplication a) { ParentSupportMethods myParentSupportMethods = new ParentSupportMethods(); myParentSupportMethods.myTA = this; string stringCommand01Button = "Set Development Path Root"; Properties.Settings.Default.AssemblyNeedLoading = true; Properties.Settings.Default.Save(); String exeConfigPath = Path.GetDirectoryName(path) + "\\" + dllName + ".dll"; a.CreateRibbonTab(TabName); RibbonPanelCurrent = a.CreateRibbonPanel(TabName, PanelName); PushButtonData myPushButtonData01 = new PushButtonData(stringCommand01Button, stringCommand01Button, exeConfigPath, dllName + ".InvokeSetDevelopmentPath"); ComboBoxData cbData = new ComboBoxData("DeveloperSwitch") { ToolTip = "Select an Option", LongDescription = "Select a number or letter" }; ComboBox ComboBox01 = RibbonPanelCurrent.AddStackedItems(cbData, myPushButtonData01)[0] as ComboBox; string stringProductVersion = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Pedersen Read Limited\\cSharpPlaypen joshnewzealand").GetValue("ProductVersion").ToString(); //Bug fix here by Max Sun (01/05/19) ComboBox01.AddItem(new ComboBoxMemberData("Release", "Release: " + stringProductVersion)); ComboBox01.AddItem(new ComboBoxMemberData("Development", "C# Developer Mode")); ComboBox01.CurrentChanged += new EventHandler <Autodesk.Revit.UI.Events.ComboBoxCurrentChangedEventArgs>(SwitchBetweenDeveloperAndRelease); //RibbonPanelCurrent.AddItem(myParentSupportMethods.myPushButton_01(Button_01, path)); RibbonPanelCurrent.AddItem(myParentSupportMethods.Button01_Start("Button01_Start", Button01_Start, path)); RibbonPanelCurrent.AddItem(myParentSupportMethods.Button02_DrawWallTypes("Button02_DrawWallTypes", Button02_DrawWallTypes, path)); RibbonPanelCurrent.AddItem(myParentSupportMethods.Button03_SetDefault("Button03_SetDefault", Button03_SetDefault, path)); RibbonPanelCurrent.AddItem(myParentSupportMethods.Button04_ManualOverrideColor("Button04_ManualOverrideColor", Button04_ManualOverrideColor, path)); RibbonPanelCurrent.AddItem(myParentSupportMethods.Button07_ExtensibleStorage("Button07_ExtensibleStorage", Button07_ExtensibleStorage, path)); PushButtonData myPushButtonData_OneClickBackup = myParentSupportMethods.Button15_SingleClickFamilyBackup("Button15_SingleClickFamilyBackup", Button15_SingleClickFamilyBackup, path); PushButtonData myPushButtonData_OpenBackupFolder = new PushButtonData("Button15_OpenBackupFolder", "Open Backup Folder", exeConfigPath, dllName + ".InvokeOpenBackupFolder"); SplitButtonData sb1 = new SplitButtonData("OneClickBackupSystem", "One Click Backup System"); SplitButton sb = RibbonPanelCurrent.AddItem(sb1) as SplitButton; sb.AddPushButton(myPushButtonData_OneClickBackup); sb.AddPushButton(myPushButtonData_OpenBackupFolder); sb.IsSynchronizedWithCurrentItem = false; RibbonPanelCurrent.AddItem(myParentSupportMethods.Button1617_AddEditParameters("Button1617_AddEditParameters", Button1617_AddEditParameters, path)); RibbonPanelCurrent.AddItem(myParentSupportMethods.Button1819_UnderstandingTransforms("Button1819_UnderstandingTransforms", Button1819_UnderstandingTransforms, path)); RibbonPanelCurrent.AddItem(myParentSupportMethods.Button02_Uninstall("Button_02_Uninstall", Button_02_Uninstall, path)); //PRLChecklistsPanel2.Visible = false; //RibbonPanel PRLChecklistsPanel2 = a.CreateRibbonPanel(TabName, PanelTransferring); //myParentSupportMethods.PlaceButtonOnModifyRibbon(); return(Result.Succeeded); }
public Result OnStartup(UIControlledApplication uiApp) { try { uiApp.CreateRibbonTab(TabName); } catch {}; RibbonPanel Panel = uiApp.CreateRibbonPanel(TabName, PanelName); ComboBoxData cb1 = new ComboBoxData("Height"); ComboBoxData cb2 = new ComboBoxData("Width"); PushButtonData b1d = new PushButtonData( "Create Detail Border", "Create Detail Border", @dllpath, "CC_ZeroPoint.CreateDetailBorder"); b1d.ToolTip = "Create a reference border for the active detail view."; var items = Panel.AddStackedItems(cb1, cb2, b1d); var cbox1 = items[0] as ComboBox; var cbox2 = items[1] as ComboBox; cbox1.AddItem(new ComboBoxMemberData("Height - 1", "Height - 1")); cbox1.AddItem(new ComboBoxMemberData("Height - 2", "Height - 2")); cbox1.AddItem(new ComboBoxMemberData("Height - 3", "Height - 3")); cbox1.AddItem(new ComboBoxMemberData("Height - 4", "Height - 4")); cbox2.AddItem(new ComboBoxMemberData("Width - 1", "Width - 1")); cbox2.AddItem(new ComboBoxMemberData("Width - 1.5", "Width - 1.5")); cbox2.AddItem(new ComboBoxMemberData("Width - 2", "Width - 2")); cbox2.AddItem(new ComboBoxMemberData("Width - 3", "Width - 3")); cbox2.AddItem(new ComboBoxMemberData("Width - 4", "Width - 4")); cbox2.AddItem(new ComboBoxMemberData("Width - 5", "Width - 5")); return(Result.Succeeded); }
private void AddCriteriaToSessionVar() { //individual selection criteria foreach (LoanInquiryCriteria criteria in this.listCriteria) { LoanInquiryCriteria inqCriteria = new LoanInquiryCriteria(); List <Control> ctrlvalues = inqCriteria.FindControls(new[] { "loaninquiry", "temp" }, criteria.Controls); if (ctrlvalues.Count > 0) { ComboBoxData dataName = criteria.DataName; string[] values = new string[3]; int i = 0; //get all non-loaninquiry* objects - these have the values foreach (Control ctrl in ctrlvalues) { switch (ctrl.GetType().Name) { case "State": ComboBox states = (ComboBox)ctrl.Controls[0]; USState state = (USState)states.SelectedItem; values[i++] = state.ShortName; break; case "Country": ComboBox countries = (ComboBox)ctrl.Controls[0]; CountryData country = (CountryData)countries.SelectedItem; values[i++] = country.Name; break; case "Gender": case "Race": case "Haircolor": case "EyeColor": ComboBox list = (ComboBox)ctrl.Controls[0]; ComboBoxData item = (ComboBoxData)list.SelectedItem; values[i++] = item.Description; break; case "Zipcode": case "Date": values[i++] = ctrl.Controls[0].Text; break; case "TextBox": case "ComboBox": values[i++] = ctrl.Text; break; } } InquirySelectedCriteria selCriteria = new InquirySelectedCriteria(criteria.loaninquiryDataTypeCombobox.SelectedItem.ToString(), dataName.Description, dataName.Code, criteria.SearchType, values, false); GlobalDataAccessor.Instance.DesktopSession.InquirySelectionCriteria.SelectedCriteria.Add(selCriteria); } } }
internal new ComboBoxData GetButtonData() { ComboBoxData cboData = new ComboBoxData(_name); if (_smallImage != null) { cboData.Image = _smallImage; } if (_toolTipsImage != null) { cboData.ToolTipImage = _toolTipsImage; } if (!string.IsNullOrWhiteSpace(_toolTips)) { cboData.ToolTip = _toolTips; } if (!string.IsNullOrWhiteSpace(_description)) { cboData.LongDescription = _description; } if (_contextualHelp != null) { cboData.SetContextualHelp(_contextualHelp); } return(cboData); }
public static void SchedulePanel(UIControlledApplication uiApp, string tabname) { RibbonPanel CPanel = uiApp.CreateRibbonPanel(tabname, "Objects"); PushButtonData pbc = new PushButtonData( "Create Schedule", "Create Schedule", @dllpath(), "CC_Plugin.CreateSchedule"); PushButtonData pbi = new PushButtonData( "Import Schedule", "Import Schedule", dllpath(), "CC_Plugin.ImportSchedule"); PushButtonData pbo = new PushButtonData( "Import Objects", "Import Objects", dllpath(), "CC_Plugin.ImportObjects"); ComboBoxData cbd = new ComboBoxData("Object Tools"); IList <RibbonItem> Buttons = CPanel.AddStackedItems(pbc, pbi, pbo); ComboBox cb = CPanel.AddItem(cbd) as ComboBox; cb.AddItem(new ComboBoxMemberData("Doors", "Doors")); cb.AddItem(new ComboBoxMemberData("Materials", "Materials")); }
private void idTypeList_DrawItem(object sender, DrawItemEventArgs e) { //if (e.Index == -1) // return; //e.DrawBackground(); //Brush textBrush = SystemBrushes.ControlText; //Font drawFont = e.Font; //ComboBoxData eIdType = (ComboBoxData)IdTypeList.Items[e.Index]; //string strToShow = eIdType.Description.ToString(); //e.Graphics.DrawString(strToShow, drawFont, textBrush, e.Bounds); //e.DrawFocusRectangle(); if (e.Index == -1) { return; } else { e.DrawBackground(); Brush textBrush = SystemBrushes.ControlText; Font drawFont = e.Font; ComboBoxData eIdType = (ComboBoxData)IdTypeList.Items[e.Index]; string strToShow = eIdType.Description.ToString(); if ((e.State & DrawItemState.Selected) > 0) { textBrush = SystemBrushes.HighlightText; } e.Graphics.DrawString(strToShow, drawFont, textBrush, e.Bounds); e.DrawFocusRectangle(); } }
public MainViewModel() { _classifer = new Classifier <string>(); _result = new ResultModel(); Data = new ComboBoxData(); ObjViewModel = new ObjectViewModel(); ClassifyObjectCmd = new RelayCommand <object>(x => Classify()); InitClassificator(); }
/// <summary> /// Class Constructor /// </summary> public HisAlarmForm(NodeInfo node) { InitializeComponent(); ComboEntity = new ComboBoxData(); CurAlarms = new List <AlarmInfo>(); CurNode = node; if (CurNode != null && Common.CurUser.Role.Devices.ContainsKey(CurNode.DevID)) { CurDev = Common.CurUser.Role.Devices[CurNode.DevID]; } }
private void ComboBoxDataBind(ComboBoxEdit cbo, int propertyId) { cbo.Properties.Items.Clear(); var cboValueList = propertyService.GetComboBoxValueByPropertyId(propertyId); foreach (var item in cboValueList) { var data = new ComboBoxData(); data.Text = item.Value; data.Value = item.Id.ToString(); cbo.Properties.Items.Add(data); } }
//进行各种按钮的属性设置 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; } }
/// <summary> /// Combo box - 5 items in 2 groups. /// Combo box is used in conjunction with event. We'll come back later. /// For now, just demonstrates how to make a combo box. /// </summary> public void AddComboBox(RibbonPanel panel) { // Create five combo box members with two groups // #1 ComboBoxMemberData comboBoxMemberData1 = new ComboBoxMemberData("ComboCommandData", "Command Data"); comboBoxMemberData1.Image = NewBitmapImage("Basics.ico"); comboBoxMemberData1.GroupName = "DB Basics"; // #2 ComboBoxMemberData comboBoxMemberData2 = new ComboBoxMemberData("ComboDbElement", "DB Element"); comboBoxMemberData2.Image = NewBitmapImage("Basics.ico"); comboBoxMemberData2.GroupName = "DB Basics"; // #3 ComboBoxMemberData comboBoxMemberData3 = new ComboBoxMemberData("ComboElementFiltering", "Filtering"); comboBoxMemberData3.Image = NewBitmapImage("Basics.ico"); comboBoxMemberData3.GroupName = "DB Basics"; // #4 ComboBoxMemberData comboBoxMemberData4 = new ComboBoxMemberData("ComboElementModification", "Modify"); comboBoxMemberData4.Image = NewBitmapImage("Basics.ico"); comboBoxMemberData4.GroupName = "Modeling"; // #5 ComboBoxMemberData comboBoxMemberData5 = new ComboBoxMemberData("ComboModelCreation", "Create"); comboBoxMemberData5.Image = NewBitmapImage("Basics.ico"); comboBoxMemberData5.GroupName = "Modeling"; // Make a combo box now ComboBoxData comboBxData = new ComboBoxData("ComboBox"); ComboBox comboBx = panel.AddItem(comboBxData) as ComboBox; comboBx.ToolTip = "Select an Option"; comboBx.LongDescription = "select a command you want to run"; comboBx.AddItem(comboBoxMemberData1); comboBx.AddItem(comboBoxMemberData2); comboBx.AddItem(comboBoxMemberData3); comboBx.AddItem(comboBoxMemberData4); comboBx.AddItem(comboBoxMemberData5); comboBx.CurrentChanged += new EventHandler <Autodesk.Revit.UI.Events.ComboBoxCurrentChangedEventArgs>(comboBx_CurrentChanged); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ISqlDataAccess sql = new SqlDataAccess(); IMainView mainView = new MainForm(); IPersonData personData = new PersonData(sql); IComboBoxData boxData = new ComboBoxData(sql); ApplicationSeed.Seed(boxData, sql); var mainPresenter = new MainPresenter(mainView, personData, boxData); mainPresenter.ShowView(); }
public static void SetComboBoxSelectIndex(ComboBox cb, string code) { if (code == null || code == "") { return; } for (int i = 0; i < cb.Items.Count; i++) { ComboBoxData obj = (ComboBoxData)cb.Items[i]; if (obj.ID == code) { cb.SelectedIndex = i; break; } } }
public Result OnStartup(UIControlledApplication application) { application.CreateRibbonTab("UCD场地工具"); RibbonPanel panel1 = application.CreateRibbonPanel("UCD场地工具", "欢迎页"); PushButtonData pbd = new PushButtonData("UCD场地工具", "欢迎使用", @"D:\Studay\CSharp\Work\Revit\HelloRevit\bin\Debug\HelloRevit.dll", "HelloRevit.Class1"); PushButton pb = panel1.AddItem(pbd) as PushButton; RibbonPanel panel2 = application.CreateRibbonPanel("UCD场地工具", "工具"); SplitButtonData splitData = new SplitButtonData("我的集合", "创建工具"); SplitButton sb = panel2.AddItem(splitData) as SplitButton; PushButtonData spd = new PushButtonData("UCD场地工具", "创建", @"D:\Studay\CSharp\Work\Revit\Create2\bin\Debug\Create2.dll", "Create2.CreateBox") { LargeImage = new BitmapImage(new Uri(@"D:\Studay\CSharp\Work\Revit\Ribbon1\img\sign_road.png")) }; sb.AddPushButton(spd); panel2.AddSeparator(); PulldownButtonData pdbd = new PulldownButtonData("UCD场地工具", "检查"); PushButtonData pushbtn = new PushButtonData("UCD场地工具", "碰撞检查", @"D:\Studay\CSharp\Work\Revit\Collision\bin\Debug\Collision.dll", "Collision.Class1"); PulldownButton btn = panel2.AddItem(pushbtn) as PulldownButton; btn.LongDescription = "检查当前物体是否碰撞"; btn.AddPushButton(pushbtn); RibbonPanel panel3 = application.CreateRibbonPanel("UCD场地工具", "文件"); ComboBoxData cbd = new ComboBoxData("选项"); ComboBox cBox = panel3.AddItem(cbd) as ComboBox; if (cBox != null) { cBox.ItemText = "选择操作"; cBox.ToolTip = "请选择想要进行的操作"; cBox.LongDescription = "选择一直接关闭,选择二关闭并修改"; ComboBoxMemberData cbmd = new ComboBoxMemberData("A", "关闭"); ComboBoxMemberData cbmd2 = new ComboBoxMemberData("B", "关闭并修改"); cbmd.GroupName = "编辑操作"; cBox.AddItem(cbmd); cBox.AddItem(cbmd2); } cBox.CurrentChanged += Change; cBox.CurrentChanged += Closed; return(Result.Succeeded); }
public Result OnStartup(UIControlledApplication application) { var tabName = "BIMBOX"; application.CreateRibbonTab(tabName); var panel = application.CreateRibbonPanel(tabName, "小工具"); var assemblyType = new Face2Face().GetType(); var location = assemblyType.Assembly.Location; var className = assemblyType.FullName; var pushButtonData = new PushButtonData("tool", "面生面", location, className); var imageSource = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\Images\tools.png"; pushButtonData.LargeImage = new BitmapImage(new Uri(imageSource)); var pushButton = panel.AddItem(pushButtonData) as PushButton; panel.AddSeparator(); var assemblyType1 = new GeometryCalculation().GetType(); var location1 = assemblyType1.Assembly.Location; var className1 = assemblyType1.FullName; var pushButtonData1 = new PushButtonData("tool1", "创建几何体", location1, className1); var imageSource1 = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\Images\3D.png"; pushButtonData1.LargeImage = new BitmapImage(new Uri(imageSource1)); var pushButton1 = panel.AddItem(pushButtonData1) as PushButton; pushButton1.AvailabilityClassName = className1; var comboBoxData = new ComboBoxData("选项"); var comboBox = panel.AddItem(comboBoxData) as ComboBox; comboBox.ItemText = "选择操作"; comboBox.ToolTip = "请选择想要进行的操作"; var comboBox1 = new ComboBoxMemberData("A", "关闭"); var comboBox2 = new ComboBoxMemberData("B", "关闭并修改"); comboBox1.GroupName = "编辑操作"; comboBox.AddItem(comboBox1); comboBox.AddItem(comboBox2); comboBox.CurrentChanged += change; comboBox.DropDownClosed += closed; return(Result.Succeeded); }
public Result OnStartup(UIControlledApplication a) { ParentSupportMethods myParentSupportMethods = new ParentSupportMethods(); myParentSupportMethods.myTA = this; string stringCommand01Button = "Set Development Path Root"; Properties.Settings.Default.AssemblyNeedLoading = true; Properties.Settings.Default.Save(); String exeConfigPath = Path.GetDirectoryName(path) + "\\" + dllName + ".dll"; a.CreateRibbonTab(TabName); RibbonPanelCurrent = a.CreateRibbonPanel(TabName, PanelName); PushButtonData myPushButtonData01 = new PushButtonData(stringCommand01Button, stringCommand01Button, exeConfigPath, dllName + ".InvokeSetDevelopmentPath"); ComboBoxData cbData = new ComboBoxData("DeveloperSwitch") { ToolTip = "Select an Option", LongDescription = "Select a number or letter" }; ComboBox ComboBox01 = RibbonPanelCurrent.AddStackedItems(cbData, myPushButtonData01)[0] as ComboBox; string stringProductVersion = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Default Company Name\\CSharp PLAYPEN II Google 'Josh API Revit'").GetValue("ProductVersion").ToString(); //Bug fix here by Max Sun (01/05/19) ComboBox01.AddItem(new ComboBoxMemberData("Release", "Release: " + stringProductVersion)); ComboBox01.AddItem(new ComboBoxMemberData("Development", "C# Developer Mode")); ComboBox01.CurrentChanged += new EventHandler <Autodesk.Revit.UI.Events.ComboBoxCurrentChangedEventArgs>(SwitchBetweenDeveloperAndRelease); RibbonPanelCurrent.AddItem(myParentSupportMethods.myPushButton_01(Button_01, path)); RibbonPanelCurrent.AddItem(myParentSupportMethods.myPushButton_02(Button_02, path)); RibbonPanel PRLChecklistsPanel2 = a.CreateRibbonPanel(TabName, PanelTransferring); //PRLChecklistsPanel2.Visible = false; myParentSupportMethods.PlaceButtonOnModifyRibbon(); return(Result.Succeeded); }
//populate screen if CashlinxDesktopSession.Instance.InquirySelectionCriteria.SelectedCriteria is populated private void PopulateScreen() { //load the query shops if (GlobalDataAccessor.Instance.DesktopSession.InquirySelectionCriteria.SelectedShops != null) { if (GlobalDataAccessor.Instance.DesktopSession.InquirySelectionCriteria.SelectedShops.Count.Equals(1)) { this.customTextBoxShop.Text = GlobalDataAccessor.Instance.DesktopSession.InquirySelectionCriteria.SelectedShops[0].Shop; this.radioButtonSearchShop.Checked = true; } else { this.radioButtonSelectShops.Checked = true; this.selectedShops = GlobalDataAccessor.Instance.DesktopSession.InquirySelectionCriteria.SelectedShops; } } //load query type switch (GlobalDataAccessor.Instance.DesktopSession.InquirySelectionCriteria.QueryType) { case InquiryDataTypes.Customer: this.radioButtonCustomerSearch.Checked = true; break; case InquiryDataTypes.Item: this.radioButtonItemSearch.Checked = true; break; case InquiryDataTypes.Loan: this.radioButtonLoanSearch.Checked = true; break; } //load sort info this.cboSortDirection.SelectedItem = GlobalDataAccessor.Instance.DesktopSession.InquirySelectionCriteria.SortDirection; MessageBox.Show(GlobalDataAccessor.Instance.DesktopSession.InquirySelectionCriteria.SortField.Description); MessageBox.Show(GlobalDataAccessor.Instance.DesktopSession.InquirySelectionCriteria.SortField.Code); ComboBoxData field = (ComboBoxData)this.cboSortField.SelectedItem; this.cboSortField.SelectedValue = field;// CashlinxDesktopSession.Instance.InquirySelectionCriteria.SortField; this.PerformLayout(); }
/// <summary> /// Adds a drop down menu for selection of a type of prism. This four types /// correspond to 4 family symbols already loaded in the working Revit document. /// </summary> /// <param name="panel">the RibbonPanel where the UI element is added</param> private void AddPrismComboBox(RibbonPanel panel) { // create a four members combo box for family instance selection //Family instance #1 ComboBoxMemberData comboBoxMemberData1 = new ComboBoxMemberData("cylinder", "cylinder prism"); //Family instance #2 ComboBoxMemberData comboBoxMemberData2 = new ComboBoxMemberData("rectangle", "rectangular prism"); //Family instance #3 ComboBoxMemberData comboBoxMemberData3 = new ComboBoxMemberData("regularpolygon", "regular polygon prism"); //Family instance #4 ComboBoxMemberData comboBoxMemberData4 = new ComboBoxMemberData("isotriangle", "isotriangle prism"); //make a combo box group group ComboBoxData comboBxData = new ComboBoxData("ComboBox"); prismComboBox = panel.AddItem(comboBxData) as ComboBox; prismComboBox.ToolTip = "select a prism to array on a curve"; prismComboBox.AddItem(comboBoxMemberData1); prismComboBox.AddItem(comboBoxMemberData2); prismComboBox.AddItem(comboBoxMemberData3); prismComboBox.AddItem(comboBoxMemberData4); }
public Result OnStartup(UIControlledApplication uiApp) { try { uiApp.CreateRibbonTab(TabName); } catch {}; RibbonPanel Panel = uiApp.CreateRibbonPanel(TabName, PanelName); TextBoxData tbd = new TextBoxData("Pattern Entry"); ComboBoxData cbd = new ComboBoxData("Pattern Type"); var items = Panel.AddStackedItems(cbd, tbd); var cbox = items[0] as ComboBox; var tbox = items[1] as TextBox; cbox.AddItem(new ComboBoxMemberData("Brick Pattern", "Brick Pattern")); cbox.AddItem(new ComboBoxMemberData("Herringbone Pattern", "Herringbone Pattern")); cbox.AddItem(new ComboBoxMemberData("Basket Pattern", "Basket Pattern")); cbox.AddItem(new ComboBoxMemberData("Plank Pattern", "Plank Pattern")); cbox.AddItem(new ComboBoxMemberData("Custom Pattern", "Custom Pattern")); tbox.Width = 250; tbox.PromptText = "Width, Height, Grout, Steps"; tbox.EnterPressed += EnterPressed; cbox.CurrentChanged += CurrentChanged; return(Result.Succeeded); }
public static void CreatePanel(UIControlledApplication uiApp) { RibbonPanel Panel = uiApp.CreateRibbonPanel(CCRibbon.tabName, PName); TextBoxData tbd = new TextBoxData(TBName); TextBox tb = Panel.AddItem(tbd) as TextBox; tb.Width = 350; tb.EnterPressed += EnterPressed; ComboBoxData cbd = new ComboBoxData("Update Type"); ComboBox box = Panel.AddItem(cbd) as ComboBox; box.AddItem(new ComboBoxMemberData("Run Command", "Run Command")); box.AddItem(new ComboBoxMemberData("Masterformat", "Masterformat")); box.AddItem(new ComboBoxMemberData("Occupant Load Factor", "Occupant Load Factor")); box.AddItem(new ComboBoxMemberData("Command Training", "Command Training")); PushButtonData OLFButtonData = new PushButtonData( "Update OLF", "Update OLF", @dllpath, "CC_Plugin.SetOLF"); PushButton PBOccLoadFactor = Panel.AddItem(OLFButtonData) as PushButton; }
private void enableStreamCopy_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBoxData selected = (sender as ComboBox).SelectedItem as ComboBoxData; settings.SaveAppSettingString("stream_copy", selected.DataValueString); }
private void audioCodec_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBoxData selected = (sender as ComboBox).SelectedItem as ComboBoxData; settings.SaveAppSettingString("audio_codec", selected.DataValueString); }
/// <summary> /// This method is used to create RibbonSample panel, and add wall related command buttons to it: /// 1. contains a SplitButton for user to create Non-Structural or Structural Wall; /// 2. contains a StackedBotton which is consisted with one PushButton and two Comboboxes, /// PushButon is used to reset all the RibbonItem, Comboboxes are use to select Level and WallShape /// 3. contains a RadioButtonGroup for user to select WallType. /// 4. Adds a Slide-Out Panel to existing panel with following functionalities: /// 5. a text box is added to set mark for new wall, mark is a instance parameter for wall, /// Eg: if user set text as "wall", then Mark for each new wall will be "wall1", "wall2", "wall3".... /// 6. a StackedButton which consisted of a PushButton (delete all the walls) and a PulldownButton (move all the walls in X or Y direction) /// </summary> /// <param name="application">An object that is passed to the external application /// which contains the controlled application.</param> private void CreateRibbonSamplePanel(UIControlledApplication application) { // create a Ribbon panel which contains three stackable buttons and one single push button. string firstPanelName = "Ribbon Sample"; RibbonPanel ribbonSamplePanel = application.CreateRibbonPanel(firstPanelName); #region Create a SplitButton for user to create Non-Structural or Structural Wall SplitButtonData splitButtonData = new SplitButtonData("NewWallSplit", "Create Wall"); SplitButton splitButton = ribbonSamplePanel.AddItem(splitButtonData) as SplitButton; PushButton pushButton = splitButton.AddPushButton(new PushButtonData("WallPush", "Wall", AddInPath, "Revit.SDK.Samples.Ribbon.CS.CreateWall")); pushButton.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "CreateWall.png"), UriKind.Absolute)); pushButton.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "CreateWall-S.png"), UriKind.Absolute)); pushButton.ToolTip = "Creates a partition wall in the building model."; pushButton.ToolTipImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "CreateWallTooltip.bmp"), UriKind.Absolute)); pushButton = splitButton.AddPushButton(new PushButtonData("StrWallPush", "Structure Wall", AddInPath, "Revit.SDK.Samples.Ribbon.CS.CreateStructureWall")); pushButton.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "StrcturalWall.png"), UriKind.Absolute)); pushButton.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "StrcturalWall-S.png"), UriKind.Absolute)); #endregion ribbonSamplePanel.AddSeparator(); #region Add a StackedButton which is consisted of one PushButton and two Comboboxes PushButtonData pushButtonData = new PushButtonData("Reset", "Reset", AddInPath, "Revit.SDK.Samples.Ribbon.CS.ResetSetting"); ComboBoxData comboBoxDataLevel = new ComboBoxData("LevelsSelector"); ComboBoxData comboBoxDataShape = new ComboBoxData("WallShapeComboBox"); IList<RibbonItem> ribbonItemsStacked = ribbonSamplePanel.AddStackedItems(pushButtonData, comboBoxDataLevel, comboBoxDataShape); ((PushButton)(ribbonItemsStacked[0])).Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "Reset.png"), UriKind.Absolute)); //Add options to WallShapeComboBox Autodesk.Revit.UI.ComboBox comboboxWallShape = (Autodesk.Revit.UI.ComboBox)(ribbonItemsStacked[2]); ComboBoxMemberData comboBoxMemberData = new ComboBoxMemberData("RectangleWall", "RectangleWall"); ComboBoxMember comboboxMember = comboboxWallShape.AddItem(comboBoxMemberData); comboboxMember.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "RectangleWall.png"), UriKind.Absolute)); comboBoxMemberData = new ComboBoxMemberData("CircleWall", "CircleWall"); comboboxMember = comboboxWallShape.AddItem(comboBoxMemberData); comboboxMember.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "CircleWall.png"), UriKind.Absolute)); comboBoxMemberData = new ComboBoxMemberData("TriangleWall", "TriangleWall"); comboboxMember = comboboxWallShape.AddItem(comboBoxMemberData); comboboxMember.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "TriangleWall.png"), UriKind.Absolute)); comboBoxMemberData = new ComboBoxMemberData("SquareWall", "SquareWall"); comboboxMember = comboboxWallShape.AddItem(comboBoxMemberData); comboboxMember.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "SquareWall.png"), UriKind.Absolute)); #endregion ribbonSamplePanel.AddSeparator(); #region Add a RadioButtonGroup for user to select WallType RadioButtonGroupData radioButtonGroupData = new RadioButtonGroupData("WallTypeSelector"); RadioButtonGroup radioButtonGroup = (RadioButtonGroup)(ribbonSamplePanel.AddItem(radioButtonGroupData)); ToggleButton toggleButton = radioButtonGroup.AddItem(new ToggleButtonData("Generic8", "Generic - 8\"", AddInPath, "Revit.SDK.Samples.Ribbon.CS.Dummy")); toggleButton.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "Generic8.png"), UriKind.Absolute)); toggleButton.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "Generic8-S.png"), UriKind.Absolute)); toggleButton = radioButtonGroup.AddItem(new ToggleButtonData("ExteriorBrick", "Exterior - Brick", AddInPath, "Revit.SDK.Samples.Ribbon.CS.Dummy")); toggleButton.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "ExteriorBrick.png"), UriKind.Absolute)); toggleButton.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "ExteriorBrick-S.png"), UriKind.Absolute)); #endregion //slide-out panel: ribbonSamplePanel.AddSlideOut(); #region add a Text box to set the mark for new wall TextBoxData testBoxData = new TextBoxData("WallMark"); Autodesk.Revit.UI.TextBox textBox = (Autodesk.Revit.UI.TextBox)(ribbonSamplePanel.AddItem(testBoxData)); textBox.Value = "new wall"; //default wall mark textBox.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "WallMark.png"), UriKind.Absolute)); textBox.ToolTip = "Set the mark for new wall"; textBox.ShowImageAsButton = true; textBox.EnterPressed += new EventHandler<Autodesk.Revit.UI.Events.TextBoxEnterPressedEventArgs>(SetTextBoxValue); #endregion ribbonSamplePanel.AddSeparator(); #region Create a StackedButton which consisted of a PushButton (delete all the walls) and a PulldownButton (move all the walls in X or Y direction) PushButtonData deleteWallsButtonData = new PushButtonData("deleteWalls", "Delete Walls", AddInPath, "Revit.SDK.Samples.Ribbon.CS.DeleteWalls"); deleteWallsButtonData.ToolTip = "Delete all the walls created by the Create Wall tool."; deleteWallsButtonData.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "DeleteWalls.png"), UriKind.Absolute)); PulldownButtonData moveWallsButtonData = new PulldownButtonData("moveWalls", "Move Walls"); moveWallsButtonData.ToolTip = "Move all the walls in X or Y direction"; moveWallsButtonData.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "MoveWalls.png"), UriKind.Absolute)); // create stackable buttons IList<RibbonItem> ribbonItems = ribbonSamplePanel.AddStackedItems(deleteWallsButtonData, moveWallsButtonData); // add two push buttons as sub-items of the moveWalls PulldownButton. PulldownButton moveWallItem = ribbonItems[1] as PulldownButton; PushButton moveX = moveWallItem.AddPushButton(new PushButtonData("XDirection", "X Direction", AddInPath, "Revit.SDK.Samples.Ribbon.CS.XMoveWalls")); moveX.ToolTip = "move all walls 10 feet in X direction."; moveX.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "MoveWallsXLarge.png"), UriKind.Absolute)); PushButton moveY = moveWallItem.AddPushButton(new PushButtonData("YDirection", "Y Direction", AddInPath, "Revit.SDK.Samples.Ribbon.CS.YMoveWalls")); moveY.ToolTip = "move all walls 10 feet in Y direction."; moveY.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "MoveWallsYLarge.png"), UriKind.Absolute)); #endregion ribbonSamplePanel.AddSeparator(); application.ControlledApplication.DocumentCreated += new EventHandler<Autodesk.Revit.DB.Events.DocumentCreatedEventArgs>(DocumentCreated); }
/// <summary> /// This method is used to create RibbonSample panel, and add wall related command buttons to it: /// 1. contains a SplitButton for user to create Non-Structural or Structural Wall; /// 2. contains a StackedBotton which is consisted with one PushButton and two Comboboxes, /// PushButon is used to reset all the RibbonItem, Comboboxes are use to select Level and WallShape /// 3. contains a RadioButtonGroup for user to select WallType. /// 4. Adds a Slide-Out Panel to existing panel with following functionalities: /// 5. a text box is added to set mark for new wall, mark is a instance parameter for wall, /// Eg: if user set text as "wall", then Mark for each new wall will be "wall1", "wall2", "wall3".... /// 6. a StackedButton which consisted of a PushButton (delete all the walls) and a PulldownButton (move all the walls in X or Y direction) /// </summary> /// <param name="application">An object that is passed to the external application /// which contains the controlled application.</param> private void CreateRibbonSamplePanel(UIControlledApplication application) { // create a Ribbon panel which contains three stackable buttons and one single push button. string firstPanelName = "Ribbon Sample"; RibbonPanel ribbonSamplePanel = application.CreateRibbonPanel(firstPanelName); #region Create a SplitButton for user to create Non-Structural or Structural Wall SplitButtonData splitButtonData = new SplitButtonData("NewWallSplit", "Create Wall"); SplitButton splitButton = ribbonSamplePanel.AddItem(splitButtonData) as SplitButton; PushButton pushButton = splitButton.AddPushButton(new PushButtonData("WallPush", "Wall", AddInPath, "Revit.SDK.Samples.Ribbon.CS.CreateWall")); pushButton.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "CreateWall.png"), UriKind.Absolute)); pushButton.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "CreateWall-S.png"), UriKind.Absolute)); pushButton.ToolTip = "Creates a partition wall in the building model."; pushButton.ToolTipImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "CreateWallTooltip.bmp"), UriKind.Absolute)); pushButton = splitButton.AddPushButton(new PushButtonData("StrWallPush", "Structure Wall", AddInPath, "Revit.SDK.Samples.Ribbon.CS.CreateStructureWall")); pushButton.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "StrcturalWall.png"), UriKind.Absolute)); pushButton.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "StrcturalWall-S.png"), UriKind.Absolute)); #endregion ribbonSamplePanel.AddSeparator(); #region Add a StackedButton which is consisted of one PushButton and two Comboboxes PushButtonData pushButtonData = new PushButtonData("Reset", "Reset", AddInPath, "Revit.SDK.Samples.Ribbon.CS.ResetSetting"); ComboBoxData comboBoxDataLevel = new ComboBoxData("LevelsSelector"); ComboBoxData comboBoxDataShape = new ComboBoxData("WallShapeComboBox"); IList <RibbonItem> ribbonItemsStacked = ribbonSamplePanel.AddStackedItems(pushButtonData, comboBoxDataLevel, comboBoxDataShape); ((PushButton)(ribbonItemsStacked[0])).Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "Reset.png"), UriKind.Absolute)); //Add options to WallShapeComboBox Autodesk.Revit.UI.ComboBox comboboxWallShape = (Autodesk.Revit.UI.ComboBox)(ribbonItemsStacked[2]); ComboBoxMemberData comboBoxMemberData = new ComboBoxMemberData("RectangleWall", "RectangleWall"); ComboBoxMember comboboxMember = comboboxWallShape.AddItem(comboBoxMemberData); comboboxMember.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "RectangleWall.png"), UriKind.Absolute)); comboBoxMemberData = new ComboBoxMemberData("CircleWall", "CircleWall"); comboboxMember = comboboxWallShape.AddItem(comboBoxMemberData); comboboxMember.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "CircleWall.png"), UriKind.Absolute)); comboBoxMemberData = new ComboBoxMemberData("TriangleWall", "TriangleWall"); comboboxMember = comboboxWallShape.AddItem(comboBoxMemberData); comboboxMember.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "TriangleWall.png"), UriKind.Absolute)); comboBoxMemberData = new ComboBoxMemberData("SquareWall", "SquareWall"); comboboxMember = comboboxWallShape.AddItem(comboBoxMemberData); comboboxMember.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "SquareWall.png"), UriKind.Absolute)); #endregion ribbonSamplePanel.AddSeparator(); #region Add a RadioButtonGroup for user to select WallType RadioButtonGroupData radioButtonGroupData = new RadioButtonGroupData("WallTypeSelector"); RadioButtonGroup radioButtonGroup = (RadioButtonGroup)(ribbonSamplePanel.AddItem(radioButtonGroupData)); ToggleButton toggleButton = radioButtonGroup.AddItem(new ToggleButtonData("Generic8", "Generic - 8\"", AddInPath, "Revit.SDK.Samples.Ribbon.CS.Dummy")); toggleButton.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "Generic8.png"), UriKind.Absolute)); toggleButton.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "Generic8-S.png"), UriKind.Absolute)); toggleButton = radioButtonGroup.AddItem(new ToggleButtonData("ExteriorBrick", "Exterior - Brick", AddInPath, "Revit.SDK.Samples.Ribbon.CS.Dummy")); toggleButton.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "ExteriorBrick.png"), UriKind.Absolute)); toggleButton.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "ExteriorBrick-S.png"), UriKind.Absolute)); #endregion //slide-out panel: ribbonSamplePanel.AddSlideOut(); #region add a Text box to set the mark for new wall TextBoxData testBoxData = new TextBoxData("WallMark"); Autodesk.Revit.UI.TextBox textBox = (Autodesk.Revit.UI.TextBox)(ribbonSamplePanel.AddItem(testBoxData)); textBox.Value = "new wall"; //default wall mark textBox.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "WallMark.png"), UriKind.Absolute)); textBox.ToolTip = "Set the mark for new wall"; textBox.ShowImageAsButton = true; textBox.EnterPressed += new EventHandler <Autodesk.Revit.UI.Events.TextBoxEnterPressedEventArgs>(SetTextBoxValue); #endregion ribbonSamplePanel.AddSeparator(); #region Create a StackedButton which consisted of a PushButton (delete all the walls) and a PulldownButton (move all the walls in X or Y direction) PushButtonData deleteWallsButtonData = new PushButtonData("deleteWalls", "Delete Walls", AddInPath, "Revit.SDK.Samples.Ribbon.CS.DeleteWalls"); deleteWallsButtonData.ToolTip = "Delete all the walls created by the Create Wall tool."; deleteWallsButtonData.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "DeleteWalls.png"), UriKind.Absolute)); PulldownButtonData moveWallsButtonData = new PulldownButtonData("moveWalls", "Move Walls"); moveWallsButtonData.ToolTip = "Move all the walls in X or Y direction"; moveWallsButtonData.Image = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "MoveWalls.png"), UriKind.Absolute)); // create stackable buttons IList <RibbonItem> ribbonItems = ribbonSamplePanel.AddStackedItems(deleteWallsButtonData, moveWallsButtonData); // add two push buttons as sub-items of the moveWalls PulldownButton. PulldownButton moveWallItem = ribbonItems[1] as PulldownButton; PushButton moveX = moveWallItem.AddPushButton(new PushButtonData("XDirection", "X Direction", AddInPath, "Revit.SDK.Samples.Ribbon.CS.XMoveWalls")); moveX.ToolTip = "move all walls 10 feet in X direction."; moveX.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "MoveWallsXLarge.png"), UriKind.Absolute)); PushButton moveY = moveWallItem.AddPushButton(new PushButtonData("YDirection", "Y Direction", AddInPath, "Revit.SDK.Samples.Ribbon.CS.YMoveWalls")); moveY.ToolTip = "move all walls 10 feet in Y direction."; moveY.LargeImage = new BitmapImage(new Uri(Path.Combine(ButtonIconsFolder, "MoveWallsYLarge.png"), UriKind.Absolute)); #endregion ribbonSamplePanel.AddSeparator(); application.ControlledApplication.DocumentCreated += new EventHandler <Autodesk.Revit.DB.Events.DocumentCreatedEventArgs>(DocumentCreated); }
private void videoMaxWidth_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBoxData selected = (sender as ComboBox).SelectedItem as ComboBoxData; settings.SaveAppSettingInt("video_max_width", selected.DataValueInt); }
private void cboSortField_SelectedIndexChanged(object sender, EventArgs e) { ComboBoxData sort = (ComboBoxData)this.cboSortField.SelectedItem; GlobalDataAccessor.Instance.DesktopSession.InquirySelectionCriteria.SortField = sort; }
/// <summary> /// Combo box - 5 items in 2 groups. /// Combo box is used in conjunction with event. We'll come back later. /// For now, just demonstrates how to make a combo box. /// </summary> public void AddComboBox(RibbonPanel panel) { // Create five combo box members with two groups // #1 ComboBoxMemberData comboBoxMemberData1 = new ComboBoxMemberData("ComboCommandData", "Command Data"); comboBoxMemberData1.Image = NewBitmapImage("Basics.ico"); comboBoxMemberData1.GroupName = "DB Basics"; // #2 ComboBoxMemberData comboBoxMemberData2 = new ComboBoxMemberData("ComboDbElement", "DB Element"); comboBoxMemberData2.Image = NewBitmapImage("Basics.ico"); comboBoxMemberData2.GroupName = "DB Basics"; // #3 ComboBoxMemberData comboBoxMemberData3 = new ComboBoxMemberData("ComboElementFiltering", "Filtering"); comboBoxMemberData3.Image = NewBitmapImage("Basics.ico"); comboBoxMemberData3.GroupName = "DB Basics"; // #4 ComboBoxMemberData comboBoxMemberData4 = new ComboBoxMemberData("ComboElementModification", "Modify"); comboBoxMemberData4.Image = NewBitmapImage("Basics.ico"); comboBoxMemberData4.GroupName = "Modeling"; // #5 ComboBoxMemberData comboBoxMemberData5 = new ComboBoxMemberData("ComboModelCreation", "Create"); comboBoxMemberData5.Image = NewBitmapImage("Basics.ico"); comboBoxMemberData5.GroupName = "Modeling"; // Make a combo box now ComboBoxData comboBxData = new ComboBoxData("ComboBox"); ComboBox comboBx = panel.AddItem(comboBxData) as ComboBox; comboBx.ToolTip = "Select an Option"; comboBx.LongDescription = "select a command you want to run"; comboBx.AddItem(comboBoxMemberData1); comboBx.AddItem(comboBoxMemberData2); comboBx.AddItem(comboBoxMemberData3); comboBx.AddItem(comboBoxMemberData4); comboBx.AddItem(comboBoxMemberData5); comboBx.CurrentChanged += new EventHandler<Autodesk.Revit.UI.Events.ComboBoxCurrentChangedEventArgs>(comboBx_CurrentChanged); }
private void audioBitrate_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBoxData selected = (sender as ComboBox).SelectedItem as ComboBoxData; settings.SaveAppSettingInt("audio_bitrate", selected.DataValueInt); }
public Result OnStartup(UIControlledApplication a) { UiCtrApp = a; try { // Register event for Syncronization // a.ControlledApplication.DocumentSynchronizingWithCentral += new EventHandler // <Autodesk.Revit.DB.Events.DocumentSynchronizingWithCentralEventArgs>(application_Sync); UiCtrApp.ViewActivated += new EventHandler <Autodesk.Revit.UI.Events.ViewActivatedEventArgs>(getdoc); } catch (Exception) { return(Result.Failed); } a.CreateRibbonTab("Exp. Add-Ins"); RibbonPanel panel_Export = a.CreateRibbonPanel("Exp. Add-Ins", "Export"); panel_ViewSetup = a.CreateRibbonPanel("Exp. Add-Ins", "View Tools"); RibbonPanel panel_Reelevate = a.CreateRibbonPanel("Exp. Add-Ins", "Re-Elevate"); RibbonPanel panel_Annot = a.CreateRibbonPanel("Exp. Add-Ins", "Annotation"); RibbonPanel panel_Managers = a.CreateRibbonPanel("Exp. Add-Ins", "Managers"); RibbonPanel panel_Spec = a.CreateRibbonPanel("Exp. Add-Ins", "Specific"); RibbonPanel panel_Qt = a.CreateRibbonPanel("Exp. Add-Ins", "Quick Tools"); string thisAssemblyPath = Assembly.GetExecutingAssembly().Location; string root = thisAssemblyPath.Remove(thisAssemblyPath.Length - 11); PushButtonData button_DWGExport = new PushButtonData("Button_DWGExport", "Export DWG", root + "DWGExport.dll", "DWGExport.DWGExport"); PushButtonData button_NavisExport = new PushButtonData("button_NavisExport", "Export NWC", root + "DWGExport.dll", "NavisExport.NavisExport"); PushButtonData button_AllExport = new PushButtonData("Button_Navis_DWGExport", "Export All", root + "DWGExport.dll", "ExportAll.ExportAll"); PushButton button_RevPrint = panel_Export.AddItem(new PushButtonData("Button_RevPrint", "Print Revision", root + "DWGExport.dll", "PrintRevision.PrintRevision")) as PushButton; button_DWGExport.ToolTip = "Selected Views/Sheets will be exported to .DWG. Tip: use Manage Save/Load selection for sets."; button_NavisExport.ToolTip = "Views with 'Export' as Title on Sheet will be exported to .NWC"; button_AllExport.ToolTip = "Views with 'Export' as Title on Sheet will be exported to .DWG and .NWC"; button_RevPrint.ToolTip = "Select and Print a certain Revision using the current print settings."; PushButtonData button_ShiftViewRange_Top_Up = new PushButtonData("Button_ShiftViewRange_Top_Up", "T+", root + "SetViewRange.dll", "SetViewRange.Shift_TU"); PushButtonData button_ShiftViewRange_Top_Down = new PushButtonData("Button_ShiftViewRange_Top_Down", "T-", root + "SetViewRange.dll", "SetViewRange.Shift_TD"); PushButtonData button_ShiftViewRange_Bottom_Up = new PushButtonData("Button_ShiftViewRange_Bottom_Up", "B+", root + "SetViewRange.dll", "SetViewRange.Shift_BU"); PushButtonData button_ShiftViewRange_Bottom_Down = new PushButtonData("Button_ShiftViewRange_Bottom_Down", "B-", root + "SetViewRange.dll", "SetViewRange.Shift_BD"); PushButtonData button_SetViewRange = new PushButtonData("Button_SetViewRange", "Set View Range per 3D", root + "SetViewRange.dll", "SetViewRange.SetPer3D"); button_ShiftViewRange_Top_Up.ToolTip = "Shifts Top of View Range by set value - Up."; button_ShiftViewRange_Top_Down.ToolTip = "Shifts Top of View Range by set value - Down."; button_ShiftViewRange_Bottom_Up.ToolTip = "Shifts Bottom of View Range by set value - Up."; button_ShiftViewRange_Bottom_Down.ToolTip = "Shifts Bottom of View Range by set value - Down."; button_SetViewRange.ToolTip = "Sets View Range of active Plan View to Top and Bottom planes of the Section Box used on identically named 3d View."; PushButtonData button_TL = new PushButtonData("ToggleLink", "Toggle Links", root + "MultiDWG.dll", "MultiDWG.ToggleLink"); PushButtonData button_TPC = new PushButtonData("TogglePC", "Toggle PCs", root + "MultiDWG.dll", "MultiDWG.TogglePC"); button_TL.ToolTip = "Toggles visibility of all Links in the active view"; button_TPC.ToolTip = "Toggles visibility of all Point Clouds in the active view"; PushButton button_RehostElements = panel_Reelevate.AddItem(new PushButtonData("Button_RehostElements", "Rehost Elements", root + "Rehost Elements.dll", "RehostElements.RehostElements")) as PushButton; PushButtonData button_AlignToBottom = new PushButtonData("Button_AlignToBottom", "MEP to Bottom", root + "AlignToBottom.dll", "AlignToBottom.AlignToBottom"); PushButtonData button_AlignToTop = new PushButtonData("Button_AlignToTop", "MEP to Top", root + "AlignToBottom.dll", "AlignToBottom.AlignToTop"); button_RehostElements.ToolTip = "Sets the Reference Level of selected elements to the active Plan View's Associated Level"; button_AlignToBottom.ToolTip = "Aligns Bottom of MEP elements to the bottom of selected MEP element"; button_AlignToTop.ToolTip = "Aligns Top of MEP elements to the top of selected MEP element"; PushButtonData button_MultiDWG = new PushButtonData("Button_MultiDWG", "MultiDWG", root + "MultiDWG.dll", "MultiDWG.MultiDWG"); PushButtonData button_DuctSurfaceArea = new PushButtonData("Button_DSA", "Duct F. Unfolded", root + "MultiDWG.dll", "MultiDWG.DuctSurfaceArea"); PushButtonData button_ConduitAngle = new PushButtonData("Button_CA", "Conduit Angles", root + "MultiDWG.dll", "MultiDWG.ConduitAngle"); button_MultiDWG.ToolTip = "Specific: Loads all .DWG-s from selected folder. Sets LOD according to filename, temporarily hides medium and high LOD-s."; button_DuctSurfaceArea.ToolTip = "Specific: Inserts total surface area without connections into \"Duct Surface Area\" Project Parameter."; button_ConduitAngle.ToolTip = "Specific: Sums the angles of selected Conduit turns"; panel_Spec.AddStackedItems(button_MultiDWG, button_DuctSurfaceArea, button_ConduitAngle); PushButtonData toggle_Insulation = new PushButtonData("Toggle_Insulation", "Align to INS", root + "AlignToBottom.dll", "Toggle.Toggle"); toggle_Insulation.ToolTip = "Aligns to Insulation surfaces, when present"; PushButtonData button_Qv1 = new PushButtonData("Qv1", "1", root + "SetViewRange.dll", "QuickViews.QuickView1"); PushButtonData button_Qv2 = new PushButtonData("Qv2", "2", root + "SetViewRange.dll", "QuickViews.QuickView2"); PushButtonData button_Qv3 = new PushButtonData("Qv3", "3", root + "SetViewRange.dll", "QuickViews.QuickView3"); PushButtonData button_Qv4 = new PushButtonData("Qv4", "4", root + "SetViewRange.dll", "QuickViews.QuickView4"); PushButtonData button_Qv5 = new PushButtonData("Qv5", "5", root + "SetViewRange.dll", "QuickViews.QuickView5"); PushButtonData button_Qv6 = new PushButtonData("Qv6", "6", root + "SetViewRange.dll", "QuickViews.QuickView6"); button_Qv1.ToolTip = "Switch View to 'QuickView 1'"; button_Qv2.ToolTip = "Switch View to 'QuickView 2'"; button_Qv3.ToolTip = "Switch View to 'QuickView 3'"; button_Qv4.ToolTip = "Switch View to 'QuickView 4'"; button_Qv5.ToolTip = "Switch View to 'QuickView 5'"; button_Qv6.ToolTip = "Switch View to 'QuickView 6'"; panel_ViewSetup.AddStackedItems(button_Qv1, button_Qv2, button_Qv3); panel_ViewSetup.AddStackedItems(button_Qv4, button_Qv5, button_Qv6); PushButton button_SetupQV = panel_ViewSetup.AddItem(new PushButtonData("Button_SetupQV", "Options", root + "SetViewRange.dll", "QuickViews.QuickViews")) as PushButton; PushButtonData button_Dim2Grid = new PushButtonData("Dimtogrid", "RackDim", root + "AnnoTools.dll", "AnnoTools.RackDim"); PushButtonData button_Rack = new PushButtonData("Rack", "Rack", root + "AnnoTools.dll", "AnnoTools.Rack"); PushButtonData button_Lin = new PushButtonData("Lin", "Linear", root + "AnnoTools.dll", "AnnoTools.LinearAnnotation"); string versioned = "AnnoTools"; if (a.ControlledApplication.VersionName.Contains("2017")) { versioned = "Exp_apps_R17"; } PushButtonData button_MTag = new PushButtonData("MTag", "MultiTag", root + versioned + ".dll", versioned + ".MultiTag"); PushButtonData button_ManageRefs = new PushButtonData("Button_ManageRefs", "Mng. Ref.Planes", root + "MultiDWG.dll", "MultiDWG.ManageRefPlanes"); PushButtonData button_ManageRevs = new PushButtonData("Button_ManageRevs", "Mng. Revisions", root + "Revision_Editor.dll", "Revision_Editor.Revision_Editor"); button_SetupQV.ToolTip = "Set quick access to views and more."; button_Dim2Grid.ToolTip = "Create Dimension referring the selected element's centerlines and Grids."; button_Rack.ToolTip = "Create tag for Conduit Rack, listing conduits: left to right \\ top to bottom"; button_Lin.ToolTip = "Create Dimension for objects with more distance in-between"; button_MTag.ToolTip = "Create Tags by Category for multiple selected elements at once"; button_ManageRefs.ToolTip = "Create Reference Planes from at the origins of 3 selected items, or Delete Ref.Planes"; button_ManageRevs.ToolTip = "Manage Revisions"; TextBoxData leftSpaceData = new TextBoxData("A"); TextBoxData rightSpaceData = new TextBoxData("B"); TextBoxData firstYData = new TextBoxData("C"); TextBoxData stepYData = new TextBoxData("1"); TextBoxData splitPointData = new TextBoxData("2"); TextBoxData placementData = new TextBoxData("3"); panel_Annot.AddStackedItems(leftSpaceData, rightSpaceData, firstYData); panel_Annot.AddStackedItems(stepYData, splitPointData, placementData); foreach (RibbonItem item in panel_Annot.GetItems()) { SetTextBox(item, "A", ":A:", "Distance of TextBoxes on Left", 60); SetTextBox(item, "B", ":B:", "Distance of TextBoxes on Right", 60); SetTextBox(item, "C", ":C:", "Height offset of TextBoxes", 60); SetTextBox(item, "1", ":1:", "Gap between TextBoxes", 60); SetTextBox(item, "2", ":2:", "Controls directional switch, and linebreaks of TextBoxes", 60); SetTextBox(item, "3", ":3:", "Placement of annotation along the reference line", 60); } PulldownButtonData QtData = new PulldownButtonData("Quicktools", "QuickTools"); PulldownButton QtButtonGroup = panel_Qt.AddItem(QtData) as PulldownButton; PushButtonData qt1 = new PushButtonData("Filter Verticals", "Filter Vert", root + "MultiDWG.dll", "MultiDWG.FindVert"); PushButtonData qt2 = new PushButtonData("Filter Round Hosted", "Filter Round Hosted", root + "AnnoTools.dll", "AnnoTools.CheckTag"); PushButtonData qt3 = new PushButtonData("Align Identicals", "Align Identicals", root + "AnnoTools.dll", "AnnoTools.Cleansheet"); PushButtonData qt4 = new PushButtonData("Replace in Parameter", "Replace in Parameter", root + "MultiDWG.dll", "MultiDWG.ReplaceInParam"); PushButtonData qt5 = new PushButtonData("Duplicate Sheets", "Duplicate Sheets", root + "MultiDWG.dll", "MultiDWG.DuplicateSheets"); qt1.ToolTip = "Filters Vertical elements from selection " + Environment.NewLine + ":1: controls vertical sensitivity"; qt2.ToolTip = "Filter the selected tags that are hosted to Round duct " + Environment.NewLine + ":3: Type for 'Rectangular' filter"; qt3.ToolTip = "Merges selected tags with same content." + Environment.NewLine + ":A: and :B: controls sensitivity"; qt4.ToolTip = "Replaces text in parameter of selection." + Environment.NewLine + ":A: - Parameter name" + Environment.NewLine + ":B: - Original" + Environment.NewLine + ":C: - Replace"; qt5.ToolTip = "Duplicates the selected sheets." + Environment.NewLine + ":A: - Suffix - Sheet Number" + Environment.NewLine + ":B: - Suffix - Sheet Name" + Environment.NewLine + ":C: - Type for Dependent view duplicates"; string IconsPath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Icons\\"); string[] files = Directory.GetFiles(IconsPath); string im_dwg = IconsPath + "Button_DWGExport.png"; string im_nwc = IconsPath + "Button_NavisExport.png"; string im_all = IconsPath + "Button_AllExport.png"; string im_reh = IconsPath + "Button_RehostElements.png"; string im_tup = IconsPath + "Button_T_UP.png"; string im_tdn = IconsPath + "Button_T_DN.png"; string im_bup = IconsPath + "Button_B_UP.png"; string im_bdn = IconsPath + "Button_B_DN.png"; string im_ins = IconsPath + "Button_Ins.png"; string im_pre = IconsPath + "Button_PrintRev.png"; string im_pre_sm = IconsPath + "Button_PrintRev_sm.png"; string im_rak = IconsPath + "Button_Rack.png"; string im_d2g_sm = IconsPath + "Button_Dim2Grid_sm.png"; string im_ref = IconsPath + "Button_Ref.png"; string im_lin_sm = IconsPath + "Button_Lin_sm.png"; string im_mtag = IconsPath + "Button_MTag.png"; string im_tl_sm = IconsPath + "Button_TL_sm.png"; string im_tpc_sm = IconsPath + "Button_TPC_sm.png"; string im_qt1 = IconsPath + "Button_qt1.png"; string im_qt2 = IconsPath + "Button_qt2.png"; string im_qt3 = IconsPath + "Button_qt3.png"; string im_qt4 = IconsPath + "Button_qt4.png"; string im_qt5 = IconsPath + "Button_qt5.png"; string im_rev = IconsPath + "Button_Rev.png"; button_DWGExport.Image = SetImage(im_dwg); button_NavisExport.Image = SetImage(im_nwc); button_AllExport.Image = SetImage(im_all); button_ShiftViewRange_Top_Up.Image = SetImage(im_tup); button_ShiftViewRange_Top_Down.Image = SetImage(im_tdn); button_ShiftViewRange_Bottom_Up.Image = SetImage(im_bup); button_ShiftViewRange_Bottom_Down.Image = SetImage(im_bdn); button_RehostElements.Image = SetImage(im_reh); button_RehostElements.LargeImage = SetImage(im_reh); toggle_Insulation.Image = SetImage(im_ins); button_RevPrint.LargeImage = SetImage(im_pre); button_RevPrint.Image = SetImage(im_pre_sm); button_Rack.Image = SetImage(im_rak); button_Dim2Grid.Image = SetImage(im_d2g_sm); button_Lin.Image = SetImage(im_lin_sm); button_MTag.LargeImage = SetImage(im_mtag); button_ManageRefs.LargeImage = SetImage(im_ref); button_ManageRefs.Image = SetImage(im_ref); button_ManageRevs.LargeImage = SetImage(im_rev); button_ManageRevs.Image = SetImage(im_rev); button_TL.Image = SetImage(im_tl_sm); button_TPC.Image = SetImage(im_tpc_sm); qt1.LargeImage = SetImage(im_qt1); qt2.LargeImage = SetImage(im_qt2); qt3.LargeImage = SetImage(im_qt3); qt4.LargeImage = SetImage(im_qt4); qt5.LargeImage = SetImage(im_qt5); QtButtonGroup.AddPushButton(qt1); QtButtonGroup.AddPushButton(qt2); QtButtonGroup.AddPushButton(qt3); QtButtonGroup.AddPushButton(qt4); QtButtonGroup.AddPushButton(qt5); ComboBoxData ShiftRange = new ComboBoxData("ShiftRange"); panel_ViewSetup.AddStackedItems(button_ShiftViewRange_Bottom_Up, button_ShiftViewRange_Bottom_Down); panel_ViewSetup.AddStackedItems(button_ShiftViewRange_Top_Up, button_ShiftViewRange_Top_Down); panel_ViewSetup.AddStackedItems(button_TL, button_TPC); panel_Export.AddStackedItems(button_DWGExport, button_NavisExport, button_AllExport); panel_ViewSetup.AddStackedItems(button_SetViewRange, ShiftRange); panel_Reelevate.AddStackedItems(button_AlignToTop, button_AlignToBottom, toggle_Insulation); panel_Managers.AddItem(button_ManageRefs); panel_Managers.AddItem(button_ManageRevs); panel_Annot.AddStackedItems(button_Dim2Grid, button_Lin, button_Rack); panel_Annot.AddItem(button_MTag); a.ApplicationClosing += a_ApplicationClosing; //Set Application to Idling a.Idling += a_Idling; return(Result.Succeeded); }