Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vba custom toolbars in autocad 2006?

Status
Not open for further replies.

jbone52

Technical User
Apr 29, 2005
7
US
For those of you running on autocad 2006 already, I am running into a problem with my custom toolbars that were created in vba. The toolbars will load fine once I run the loading macro, but even though I use the save option to save the toolbar, it won't carry over when autocad is started up the next time. I makes me load the toolbar each time.

2nd issue that I am running into: when you enter the customize interface in autocad 2006, none of my toolbars that were created in vba show up. Am I missing a step?

Any help would be great! Here is a code example when I load my toolbars:

Public Sub ToolsToolbar()
Dim MenuGroupObj As AcadMenuGroup
Dim ToolbarObj As AcadToolbar
Dim ButtonObj As AcadToolbarItem

On Error GoTo error
'delete the toolbar if it exists
ThisDrawing.Application.MenuGroups.Item("FEI").Toolbars.Item("Tools").Delete

error:
'set variables
Set MenuGroupObj = ThisDrawing.Application.MenuGroups.Item("FEI")
Set ToolbarObj = MenuGroupObj.Toolbars.Add("Tools")
'add the buttons
Set ButtonObj = ToolbarObj.AddToolbarButton(0, "Length of lines", "Find length of selected lines", "-vbarun p:/jason/business/AutocadCustomToolbar/mystuff.dvb!module2.length" & vbCr)
ButtonObj.SetBitmaps "c:\acadr05\macro.bmp", "c:\acadr05\macro.bmp"

'show the toolbar
ToolbarObj.Visible = True
MenuGroupObj.Save (acMenuFileCompiled)

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top