博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Revit 命令添加下拉框
阅读量:6291 次
发布时间:2019-06-22

本文共 3595 字,大约阅读时间需要 11 分钟。

在学习revit制作下拉框时,需要分为三个步骤:

1.创建一个面板(panel)。

RibbonPanel panel10 = application.CreateRibbonPanel(Globals.DiagnosticsTabName, "图纸生成");

2.给面板添加组,实现下拉框的效果  。              

AddPulldownButtonGroup1(panel10);

3.在组中添加单独的按钮。

       

private void AddPulldownButtonGroup1(RibbonPanel panel)        {            if (1 == 1)            {               PulldownButtonData group1Data = new PulldownButtonData("PulldownGroup1", "门窗");                PulldownButton group1 = panel.AddItem(group1Data) as PulldownButton;                BitmapImage largeimage41 = new BitmapImage();                largeimage41.BeginInit();                largeimage41.UriSource = new Uri(@"C:\Kingcarrier\icon\mengchuang.png");                largeimage41.DecodePixelWidth = 20;                largeimage41.DecodePixelHeight = 20;                largeimage41.EndInit();                group1.LargeImage = largeimage41;    PushButtonData itemData13 = new PushButtonData("itemName13", "插入单门", FileUtility.GetAssemblyFullName(), typeof(door).FullName);                PushButton item13 = group1.AddPushButton(itemData13) as PushButton;                item13.ToolTip = itemData13.Text;  // Can be changed to a more descriptive text.                 item13.Image = new BitmapImage(new Uri(@"C:\Kingcarrier\icon\报价清单.png"));                item13.LargeImage = new BitmapImage(new Uri(@"C:\Kingcarrier\icon\报价清单.png"));       PushButtonData itemData131 = new PushButtonData("itemName131", "改门方向", FileUtility.GetAssemblyFullName(), typeof(changedoor).FullName);                PushButton item131 = group1.AddPushButton(itemData131) as PushButton;                item131.ToolTip = itemData131.Text;  // Can be changed to a more descriptive text.                 item131.Image = new BitmapImage(new Uri(@"C:\Kingcarrier\icon\报价清单.png"));                item131.LargeImage = new BitmapImage(new Uri(@"C:\Kingcarrier\icon\报价清单.png"));                group1.AddSeparator();                PushButtonData itemData132 = new PushButtonData("itemName132", "添加H件", FileUtility.GetAssemblyFullName(), typeof(addHtoWindow).FullName);                PushButton item132 = group1.AddPushButton(itemData132) as PushButton;                item132.ToolTip = itemData132.Text;  // Can be changed to a more descriptive text.                 item132.Image = new BitmapImage(new Uri(@"C:\Kingcarrier\icon\报价清单.png"));                item132.LargeImage = new BitmapImage(new Uri(@"C:\Kingcarrier\icon\报价清单.png"));                group1.AddSeparator();                PushButtonData itx1 = new PushButtonData("itemName1", "插入单窗", FileUtility.GetAssemblyFullName(), typeof(window).FullName);                PushButton it1 = group1.AddPushButton(itx1) as PushButton;                it1.ToolTip = itx1.Text;  // Can be changed to a more descriptive text.                 it1.Image = new BitmapImage(new Uri(@"C:\Kingcarrier\icon\报价清单.png"));                it1.LargeImage = new BitmapImage(new Uri(@"C:\Kingcarrier\icon\报价清单.png"));                group1.AddSeparator();                PushButtonData itx2 = new PushButtonData("itemName2", "插入连窗", FileUtility.GetAssemblyFullName(), typeof(twowindow).FullName);                PushButton it2 = group1.AddPushButton(itx2) as PushButton;                it2.ToolTip = itx2.Text;  // Can be changed to a more descriptive text.                 it2.Image = new BitmapImage(new Uri(@"C:\Kingcarrier\icon\报价清单.png"));                it2.LargeImage = new BitmapImage(new Uri(@"C:\Kingcarrier\icon\报价清单.png"));            }            panel.AddSeparator();

 

同样的在组中可以设计组的名称然后再去设置组中的每一个按钮,并且实现相应的功能。

转载于:https://www.cnblogs.com/sunny-su/p/10642635.html

你可能感兴趣的文章
php--------获取当前时间、时间戳
查看>>
Spring MVC中文文档翻译发布
查看>>
docker centos环境部署tomcat
查看>>
JavaScript 基础(九): 条件 语句
查看>>
Linux系统固定IP配置
查看>>
配置Quartz
查看>>
Linux 线程实现机制分析
查看>>
继承自ActionBarActivity的activity的activity theme问题
查看>>
设计模式01:简单工厂模式
查看>>
项目经理笔记一
查看>>
Hibernate一对一外键双向关联
查看>>
mac pro 入手,php环境配置总结
查看>>
MyBatis-Plus | 最简单的查询操作教程(Lambda)
查看>>
rpmfusion 的国内大学 NEU 源配置
查看>>
spring jpa 配置详解
查看>>
IOE,为什么去IOE?
查看>>
Storm中的Worker
查看>>
dangdang.ddframe.job中页面修改表达式后进行检查
查看>>
Web基础架构:负载均衡和LVS
查看>>
Linux下c/c++相对路径动态库的生成与使用
查看>>