Public Sub AddCommandMgr()
Dim cmdGroup As ICommandGroup
Dim iBmp As New BitmapHandler
Dim thisAssembly As Assembly
thisAssembly = System.Reflection.Assembly.GetAssembly(Me.GetType())
cmdGroup = iCmdMgr.CreateCommandGroup(1, "SwTool", "SwTool插件", "", -1)
'cmdGroup.LargeIconList = iBmp.CreateFileFromResourceBitmap("CallSwTool.ToolbarLarge.bmp", thisAssembly)
'cmdGroup.SmallIconList = iBmp.CreateFileFromResourceBitmap("CallSwTool.ToolbarSmall.bmp", thisAssembly)
cmdGroup.LargeMainIcon = iBmp.CreateFileFromResourceBitmap("CallSwTool.MainIconLarge.bmp", thisAssembly)
cmdGroup.SmallMainIcon = iBmp.CreateFileFromResourceBitmap("CallSwTool.MainIconSmall.bmp", thisAssembly)
'cmdGroup.AddCommandItem("CreateCube", -1, "Create a cube", "Create cube", 0, "CreateCube", "", 0)
'cmdGroup.AddCommandItem("Show PMP", -1, "Display sample property manager", "Show PMP", 2, "ShowPMP", "PMPEnable", 2)
cmdGroup.AddCommandItem("启动SwTool", -1, "启动SwTool", "启动SwTool", 0, "StartSwTool", "", 0)
cmdGroup.AddSpacer(1)
cmdGroup.AddCommandItem("另存为CAD", -1, "另存当前文档为CAD", "", 0, "SaveAsCAD", "", 0)
cmdGroup.AddSpacer(3)
cmdGroup.AddCommandItem("关于", -1, "关于SwTool", "关于SwTool", 0, "FrmAbout", "", 0)
cmdGroup.HasToolbar = False
cmdGroup.HasMenu = True
cmdGroup.Activate()
thisAssembly = Nothing
iBmp.Dispose()
End Sub |