Custom Icons on 2010 ribbon menu

Custom Icons on 2010 ribbon menu

Anonymous
Not applicable
1,735 Views
6 Replies
Message 1 of 7

Custom Icons on 2010 ribbon menu

Anonymous
Not applicable
I have a couple of macros in the user commands section of my Inventor 2010 ribbon menu.
All the icons are the same. Is there a way to add my own custom icons to each of the different macros?
I used to find that when I hovered over the icon the name of the macro would appear as a tool tip.
This has stopped working, so I have to take a guess as to which icon runs which macro.
Any suggestions greatley appreciated.

Regards

BobT
0 Likes
1,736 Views
6 Replies
Replies (6)
Message 2 of 7

ACEDeSmedt
Advocate
Advocate
If your macro's are in the default project file then:

put a bitmap file in the same folder as your default project.

The name of the file should be like this:
MyModuleName.MyMacroName.Small.bmp
MyModuleName.MyMacroName.Large.bmp

The small image has a size of 16x16, the large a size of 32x32.
Restart inventor to see the change

Use [paint.NET|http://paint.net] to edit your images.

Grtz,
Klaas De Smedt
=================================
If this is the solution, push the solution button 😉 (and maybe some kudos)
Autodesk Product Design Suit - Ultimate edition (Subscription)
0 Likes
Message 3 of 7

Anonymous
Not applicable
In my default project I have a module called DespatchModule.

In my application options, the VBA project is G:\3D\inventor code\Default2010.ivb

So I have the following Icon G:\3D\inventor code\DespatchModule.RevUp.Large.bmp
for the macro Public Sub RevUp()

This does not work!

Any thoughts???

Edited by: sanderson81 on Mar 1, 2010 9:58 PM Edited by: sanderson81 on Mar 1, 2010 9:58 PM
0 Likes
Message 4 of 7

Anonymous
Not applicable
Good question. Here's a new blog post to address that.

http://modthemachine.typepad.com/my_weblog/2010/03/buttons-for-vba-macros-in-the-ribbon-user-interface.html

Basically, you need to create a small version of the icon since that's all
that is used by the ribbon for custom commands.

--
Brian Ekins
Inventor API Product Designer
http://blogs.autodesk.com/modthemachine
0 Likes
Message 5 of 7

ACEDeSmedt
Advocate
Advocate
There is only one way to use the large icon but there is a huge drawback.

Using large Icons:

If you look at the Inventor 2010 API Object Model you can notice in the second column under Application.UserInterface a new object called Ribbons

Inventor 2010 API Object Model:
http://images.autodesk.com/adsk/files/inventor2010model.pdf

with these objects you can create and edit ribbons. And there is an option UseLargeIcon

like this :
ThisApplication.UserInterfaceManager.Ribbons("ZeroDoc").RibbonTabs("id_TabTools").RibbonPanels("id_PanelZ_ToolsContentCenter").CommandControls("CCV2BatchPublishButton").UseLargeIcon = True

The Drawback:

Inventor does not save the ribbon bar (except the list of custom commands)
Every time Inventor starts up, you have to manually run a macro (from VBA) to setup your ribbon bar

An advantage for using plug-ins is that they can run on inventor start up, setting up there own ribbon bar

If any one has a solution of the start up problem, please tell me

regards,
Klaas De Smedt
http://www.ace.eu/ Edited by: ACEDeSmedt on Mar 3, 2010 9:15 AM
=================================
If this is the solution, push the solution button 😉 (and maybe some kudos)
Autodesk Product Design Suit - Ultimate edition (Subscription)
0 Likes
Message 6 of 7

skyngu
Collaborator
Collaborator

hi, is there any way to wrap text under icon? my sub's name is too long. thanks

Autodesk Inventor Professional 2019
0 Likes
Message 7 of 7

ACEDeSmedt
Advocate
Advocate

Not that I know of.

 

Maybe vbNewLine or \r\n

 

What you can do is create a kind of shortcut macro with a shorter name that fires the macro you need

=================================
If this is the solution, push the solution button 😉 (and maybe some kudos)
Autodesk Product Design Suit - Ultimate edition (Subscription)
0 Likes