New Ribbon Tab in VB.NET

New Ribbon Tab in VB.NET

awatt
Advocate Advocate
2,096 Views
4 Replies
Message 1 of 5

New Ribbon Tab in VB.NET

awatt
Advocate
Advocate

Struggling newbie.  I can't get a new ribbon tab to display.  Using Inventor 2015 (trial for the moment), Visual Basic 2010 Express.

Whatever else I might be doing wrong, I don't understand the ClientId that the RibbonTabs.Add asks for.  I found the ClassId and ClientId in the .addin file.  I also found the Guid number in the AssemblyInfo.vb file.  None of these seemed to work.

 

Compile is normal, com visibility is checked, addin shows as loaded in Inventor addin list, Messagebox in the TRY is correctly displaying the object type.(50424832)

 

Will the tab display before it is populated with a panel?

 

#Region "ApplicationAddInServer Members"

Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate

m_inventorApplication = addInSiteObject.Application

 

If firstTime = True Then

'Get ZeroDocRibbon object

Dim Ribbon As Inventor.Ribbon

Ribbon = m_inventorApplication.UserInterfaceManager.Ribbons.Item("ZeroDoc")

'Add VC Tab to ZeroDoc Ribbon

Dim oTabZeroDoc As Inventor.RibbonTab

Try

oTabZeroDoc = Ribbon.RibbonTabs.Add("Vac-Con", "id_VCZDTab", _

"{8ed71b22-8b81-4ab9-8d27-1e8774c0ae19}", _

"id_TabTools", False, False)

oTabZeroDoc.Visible = True

MsgBox(oTabZeroDoc.Type)

Catch ex As Exception

MsgBox("ZeroDoc Tab not created")

End Try

End If

 

End Sub

0 Likes
2,097 Views
4 Replies
Replies (4)
Message 2 of 5

xiaodong_liang
Autodesk Support
Autodesk Support
Hi,

the guid required in RibbonTabs.Add is ClassId and ClientId in the .addin file, or GuidAttribute that defines the attribute of your addin class. It is NOT the Guid number in the AssemblyInfo.vb file. That is the guid of the dll.

You codes looks fine to me, and you also mentioned the codes can run to MsgBox(oTabZeroDoc.Type).

if you debug, can you see the tab has been added to tabs collection?

It will be more helpful if you could provide a small project. Code snippet does not always help because it does not tell the context how the problem would occur.
0 Likes
Message 3 of 5

awatt
Advocate
Advocate

I might have found the problem.  I suspect the new tab won't actually display until it has been populated with at least one panel and the panel has been populated with at least one control.

I noticed a similar problem with new panels in existing tabs not displaying until it had at least one control in it.

 

Message 4 of 5

xiaodong_liang
Autodesk Support
Autodesk Support
Hi,

Thank you for the update that explains the reason. I am not sure whether this could be looked as a problem, but it is more sense to me a tab/panel should contain at least one panel/button, otherwise it is meaningless a blank tab/panel displays on UI.
0 Likes
Message 5 of 5

ranjan_senapati
Explorer
Explorer

How to add RibbonTab though vb.net for inventor 2023. Please suggest

0 Likes