用VB.net在CAD下动态加载菜单
public class class1 <BR>'<BR>Dim acadapp As AcadApplication = Application.AcadApplication<BR>'<BR><CommandMethod("addmenu")> _<BR>public sub addmenu ()<BR>Dim mymenu As AcadPopupMenu = acadapp.MenuGroups.Item(0).Menus.Add("&Mymenu")<BR>dim m1 as AcadPopupMenuItem = mymenu.AddMenuItem(0, "&Line", "line ")<BR>mymenu.AddSeparator(1)<BR>dim m2 As AcadPopupMenu = mymenu.AddSubMenu(2, "&Submenu")<BR>dim m3 as AcadPopupMenuItem = m2.AddMenuItem(3, "&Circle", "circle ")<BR>dim m4 as AcadPopupMenuItem = m2.AddMenuItem(4, "&Arc", "arc ")<BR>mymenu.InsertInMenuBar(12)<BR>end sub<BR>end class<BR>向CAD中加入自已的菜单,摸索了好多天。唉。。。。<BR>在此拿出来供大家分享。 不错,顶起 能用吗? 本帖最后由 作者 于 2006-4-26 21:55:59 编辑 <br /><br /> <P>当然能用.你可以上机试试。我在网上找了很久都没有。我只好一点一点摸索着找出来的。</P> 系统菜单怎么能够动态隐藏? <P>我没试过隐藏,不过可以试试.</P> <P> For i As Integer = 0 To app.MenuGroups.Count - 1<BR> app.MenuGroups.Item(i).Unload()<BR> Next</P><P>这样就可以把CAD自带的菜单都卸载掉了</P> <P>不错,试了一下,确实可行!</P>
<P>但在C#.net中找了很久,也没弄出来,楼主可否再赐教……</P> C#和VB.NET中编程是一样的。我没用C#。 <STRONG>不错,可以试试</STRONG>