Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello people
Im wondering if there is any way that I can assign icons to a newly created toolbar?
this is my code, its running perfect, but when the toolbar is created, it just shows the default Icons and all the same.
How can I assign icons to this toolbar with vba?
like giving a FilePath and a File name ex. *wmf file.
Public Sub CreateToolbar()
Dim MenuGroupObject As AcadMenuGroup
Dim ToolbarObject As AcadToolbar
Dim ToolbarItemObject As AcadToolbarItem
Dim ButtonObject As AcadToolbarItem
Set MenuGroupObject = ThisDrawing.Application.MenuGroups.Item(0)
Set ToolbarObject = MenuGroupObject.Toolbars.Add("New Dimensions")
Set ButtonObject = ToolbarObject.AddToolbarButton(0, "Align", "alignment dimension", "-vbarun ThisDrawing.AlignedDimension" & vbCr)
Set ButtonObject = ToolbarObject.AddToolbarButton(1, "Ordinate", "ordinate dimension", "-vbarun ThisDrawing.OrdinateDimension" & vbCr)
10 Set ButtonObject = ToolbarObject.AddToolbarButton(2, "Rotate", "rotate dimension", "-vbarun ThisDrawing.RotateDimension" & vbCr)
Set ButtonObject = ToolbarObject.AddSeparator(2)
12 Set ButtonObject = ToolbarObject.AddToolbarButton(4, "Angular", "angular dimension", "-vbarun ThisDrawing.AngularDimension" & vbCr)
13 Set ButtonObject = ToolbarObject.AddToolbarButton(5, "Diametric", "diametric dimension", "-vbarun ThisDrawing.DiametricDimension" & vbCr)
14 Set ButtonObject = ToolbarObject.AddToolbarButton(6, "Radial", "radial dimension", "-vbarun ThisDrawing.RadialDimension" & vbCr)
15 ToolbarObject.Visible = True
16 End Sub
by the way, how can i fix my toolbar position? is there anyway this can be done by code?
Solved! Go to Solution.