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