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: 

Ribbonbar IV2015 position of button

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
w.pepping
415 Views, 2 Replies

Ribbonbar IV2015 position of button

Is it possible to place a custom add-in button with code before the new select-button in Inventor 2015? See attached image for what I mean.

Get control of your sheet metal files.
Download the app from matprop.com
2 REPLIES 2
Message 2 of 3
Rene_Gerlach
in reply to: w.pepping

you can add your RibbonPanel before the select, if you set "TargetPanelInternalName" to id_PanelP_ShowPanels and InsertBeforTarget to True.

 

like this:

RibbonPanels.Add("MatProp", "InternalMatProp", "your ClientId", "id_PanelP_ShowPanels", True)

 

Hope this helps.

Message 3 of 3

Yes as Rene mentioned, get the internaleName of the target and use the insertBefore = true/false to place your item before/after that target.

 

You can use the API to iterate all ribbon items to find out the internale names:

 

'// Dump Ribbon internal names to txt file
Public Function space(nb As Long) As String Dim res As String Dim i As Long For i = 0 To nb res = res & " " Next End Function Public Function AlignString(txt As String, size As Long) As String Dim nbSpace As Long nbSpace = size - Len(txt) If (nbSpace > 0) Then txt = txt & space(nbSpace) AlignString = txt Exit Function End If AlignString = txt End Function Public Sub PrintRibbon() Open "C:\temp\RibbonNames.txt" For Output As #1 Dim oControl As CommandControl Print #1, "File controls" For Each oControl In ThisApplication.UserInterfaceManager.FileBrowserControls If Not oControl.ControlType = kSeparatorControl Then Print #1, " Control: "; oControl.DisplayName & ", " & oControl.InternalName & ", Visible: " & oControl.Visible Else Print #1, " Control: Seperator" End If On Error GoTo 0 Next Dim oRibbon As ribbon For Each oRibbon In ThisApplication.UserInterfaceManager.Ribbons Print #1, " " Print #1, "-----------------------------------------------------------------" Print #1, "Ribbon: " & oRibbon.InternalName Print #1, " " Dim oTab As ribbonTab For Each oTab In oRibbon.RibbonTabs Print #1, " " Print #1, " -----------------------------------------------------------------" Print #1, " Tab: " & oTab.DisplayName & ", " & oTab.InternalName & ", Visible: " & oTab.Visible Print #1, " " If (oTab.RibbonPanels.count > 0) Then Dim oPanel As RibbonPanel For Each oPanel In oTab.RibbonPanels Print #1, " " Print #1, " " Print #1, " Panel: " & oPanel.DisplayName & ", " & oPanel.InternalName & ", Visible: " & oPanel.Visible Print #1, " " Print #1, " " For Each oControl In oPanel.CommandControls Print #1, " [Control]: " & AlignString(oControl.DisplayName, 30) _ & AlignString(oControl.InternalName, 30) _ & "[Visible: " & oControl.Visible & "]" Next For Each oControl In oPanel.SlideoutControls Print #1, " [Control]: " & AlignString(oControl.DisplayName, 30) _ & AlignString(oControl.InternalName, 30) _ & "[Visible: " & oControl.Visible & "]" Next Next End If Next Next Close #1 End Sub

 

Please flag the post as solved.

 

Thanks,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report