- 积分
- 177
- 明经币
- 个
- 注册时间
- 2008-5-30
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2011-6-3 16:59:23
|
显示全部楼层
Autodesk.AutoCAD.Interop.AcadPopupMenu popMenu;
[CommandMethod("myMenu")]
public static void mymenu()
{
Autodesk.AutoCAD.Interop.AcadApplication acadApp=Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication as Autodesk.AutoCAD.Interop.AcadApplication;
try
{
popMenu = acadApp.MenuGroups.Item(0).Menus.Add("我的菜单");
Autodesk.AutoCAD.Interop.AcadPopupMenuItem popItem0 = popMenu.AddMenuItem(0, "设置地形图目录", "_setmappath ");
Autodesk.AutoCAD.Interop.AcadPopupMenuItem popItem1 = popMenu.AddMenuItem(1, "查询图号", "_shoumapname ");
Autodesk.AutoCAD.Interop.AcadPopupMenuItem popItem2 = popMenu.AddMenuItem(2, "插入地形图", "_insertMap ");
//Autodesk.AutoCAD.Interop.AcadPopupMenuItem popItem3 = popMenu.AddMenuItem(3, "查询图号", "_sssss ");
popMenu.InsertInMenuBar(11);
}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
MessageBox.Show(ex.Message.ToString());
} |
|