.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating new customized menu and toolbar in Autocad 2010 using VB.NET

5 REPLIES 5
Reply
Message 1 of 6
shashidhara_n
6028 Views, 5 Replies

Creating new customized menu and toolbar in Autocad 2010 using VB.NET

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.

 

http://through-the-interface.typepad.com/through_the_interface/2010/04/adding-to-autocads-applicatio...

 

Thanks & Regards,

Shashidhara N

 

 

 

5 REPLIES 5
Message 2 of 6
wayne.brill
in reply to: 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



Wayne Brill
Developer Technical Services
Autodesk Developer Network

Message 3 of 6

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")

Message 4 of 6

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 "

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 5 of 6
sa_deshpande
in reply to: wayne.brill

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

Message 6 of 6
sa_deshpande
in reply to: sa_deshpande

hi,I got this , Just One question how to add nested PopUpmenuitems to existing One.

Thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost