How can I add a new menu item to Inventor menu?

How can I add a new menu item to Inventor menu?

Anonymous
Not applicable
525 Views
3 Replies
Message 1 of 4

How can I add a new menu item to Inventor menu?

Anonymous
Not applicable
Hi everybody,
I want to add a new menu item after 'Help' in Inventor menu. How do I do that?

Regards
Rahul
0 Likes
526 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
HI,
it's pretty straight forward.

Get the HelpMenu (IIRC its name is AppHelpMenu, use the UserInterfaceManager.CommandBars property) and add the Button at the position you want it (using the addButton method).

hth
neutro
0 Likes
Message 3 of 4

naresh_kalyan
Advocate
Advocate

Hi all,

I want to add a Menu item as shown in image file. Can someone tell me with a small code snippet.

Thanking you in advance.

So far, I have added a Buttons under Tools.

 

Anyone's help would be greatly appreciated.

 

Regards

NKalyan

0 Likes
Message 4 of 4

Anonymous
Not applicable

Hi Naresh/Rahul,

 

Below is a VB.net snippet which i was using earlier to add a Ribbon Tab when Part Document Is active.

 

Dim conDefs As Inventor.ControlDefinitions = m_inventorApplication.CommandManager.ControlDefinitions

Dim idCommand1 As String = "ID_COMMAND_1"

Try
              'Get the existing Command Defition
             _defComando1 = conDefs.Item(idCommand1)
Catch ex As Exception
             _defComando1 = conDefs.AddButtonDefinition("Command 1", idCommand1, CommandTypesEnum.kEditMaskCmdType,                                                                                     Guid.NewGuid().ToString(), "Command 1 Description", "Command 1 ToolTip", GetICOResource("VaultInventorItem.Export.ico"),                GetICOResource("VaultInventorItem.Export.ico"))
End Try

 

If (firstTime) Then
If (m_inventorApplication.UserInterfaceManager.InterfaceStyle = InterfaceStyleEnum.kRibbonInterface) Then
        '1. Access the zero Doc Ribbon
        Dim ribbonPart As Inventor.Ribbon = m_inventorApplication.UserInterfaceManager.Ribbons.Item("Part")

 

       '2. Create out custom Tab
       Dim tabSample As Inventor.RibbonTab = ribbonPart.RibbonTabs.Add("sampleBlog", "TAB_SAMPLE_BLOG", Guid.NewGuid.ToString())

 

       '3. Create a Panel
       Dim pnlMyCommands As Inventor.RibbonPanel = tabSample.RibbonPanels.Add("My Command", "PNL_MY_COMMANDS",                                                                                     Guid.NewGuid.ToString())

     

       '4. Add the button to the panel
       pnlMyCommands.CommandControls.AddButton(_defComando1, True)
End If
End If

 

AddHandler _defComando1.OnExecute, AddressOf Command3Method

 

You can also refer to the Sample code snippets shipped along with inventor where you can add Ribbon tabs and Ribbon menus, etc....

 

Accept this as a solution if this..Helps