Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3 REPLIES 3
Reply
Message 1 of 4
Rahul Nakhe
385 Views, 3 Replies

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

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

Regards
Rahul
3 REPLIES 3
Message 2 of 4
neutro
in reply to: Rahul Nakhe

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
Message 3 of 4
naresh_kalyan
in reply to: neutro

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

Message 4 of 4

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

Regards
Santosh

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

Post to forums  

Autodesk Design & Make Report