AcadApplication AcadApp; AcadApp = (AcadApplication)Marshal.GetActiveObject("AutoCAD.Application"); AcadPopupMenu Mymenu = AcadApp.MenuGroups.Item(0).Menus.Add("胡磊"); Mymenu.AddMenuItem(0, "直线", "_line "); Mymenu.AddMenuItem(1, "圆", "_circle "); Mymenu.AddSeparator(2); AcadPopupMenu subm = Mymenu.AddSubMenu("", "子菜单");//下级菜单 subm.AddMenuItem(0, "射线", "Xline "); Mymenu.AddMenuItem(4, "圆弧", "_ARC "); Mymenu.AddMenuItem(5, "关于", "师兄QQ361865648"); //Autodesk.AutoCAD.Windows.MenuItem mi, mi2; //mi = new Autodesk.AutoCAD.Windows.MenuItem("huhua"); //mi2 = new Autodesk.AutoCAD.Windows.MenuItem("huming"); Mymenu.InsertInMenuBar(14);//插入到当前菜单组14
|