Hi,
I am trying to create new custom menu and toolbar in autocad 2010 using VB.NET / C#. I tried in google i didn't get proper help. i tried the below URL for adding exisitng toolbar and menu. But i need to create new one. Please please please help me.
Thanks & Regards,
Shashidhara N
Hi,
Here is an example that adds menu elements to the CUIx file using the AutoCAD.NET Customization namespace. (reference accui.dll) If you do not want to change the main CUIx file then you can use a Partial CUIx file. In either case the API is the similar. (other than the CustomizationSection). This example is from the ADN website.
If you do not want to work with the CUIx files at all, you can use the COM API to create toolbars and pulldown menus. (these are not automatically created the next time AutoCAD is started) The 2010 Developer's Guide that ships with AutoCAD 2010 has examples. (see this help directory see this file - acad_dev180.chm)
Wayne Brill
Autodesk Developer Network
I dont know how this works
tbBtn.MacroID = "<my command method>"
all that happens is an error is caught saying object reference not set
what i'm i missing?
also are customizations going away because i'm using autocad map 3d 2011 x64 and i want a toolbar and i cant find anything that works except
'' Create toolbar
Dim toolbar As Object = Application.MenuGroups.item(0).Toolbars.add("Field Engineering ToolBar")
'' Directory of bitmap images
'Dim dir As String = "C:\Program Files\Autodesk\AutoCAD Map 3D 2011\FEimages"
'' New Map Button
Dim mapBtn As Object = toolbar.AddToolbarButton(0, "Make Map Button", "Helpstring button", "MAKEMAP ", False)
mapBtn.SetBitmaps(dir & "\Map_bmp.BMP", dir & "\Map_bmp.BMP")
Hi,
The sample shoud still work ok.
The MacroID requires a unique identifier of a menu macro.
In the sample project, please look for "CreateMenuMacro".
The third parameter to this method is the Unique identifier of the macro.
The second parameter to this method is the actual macro that will invoke your command which should be for example : "^C^CMyCommand "
Hi ,
I have viewd your code,I have a doubt after adding New PopupMenuItem how to bind new event or command with that perticular PopupmenuItem.
Please Revert back with it ASAP.
Regards,
Sudarshan
hi,I got this , Just One question how to add nested PopUpmenuitems to existing One.
Thanks.