Programmatically Check Tab if Exist in ArcGIS Pro

465
4
04-03-2022 06:01 PM
hadric1209
New Contributor

Hi. We would like to check if a tab with some caption (eg. My Tab) already exist or not. if not existing, create the tab dynamically/programmatically and if exist, add the new button/group in that tab.  Is that possible to dynamically/programmatically create the tab?

Use case will be, if there will more than one developer creating buttons/functions but want only to add those buttons in one similar tab without adding a new tab with the same caption multiple times.

Thank you.

@Wolf @UmaHarano 🙂

Tags (1)
0 Kudos
4 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

 You can't directly add button to tab. You can add button to group in tab. You can update every group if you know id of the group. How to insert button into  a group owned by different module you can find here:

ProGuide Buttons · Esri/arcgis-pro-sdk Wiki · GitHub

Change refid to your group id. 

You can create one add-ins with tab and group but without buttons. In other add-ins you can reuse first add-in infrastructure to place buttons or other controls.

0 Kudos
hadric1209
New Contributor

Hello, can this be done programmatically or only using the config.daml files for each of the new buttons that will be added in a group on the same Tab without knowing the ID but caption of the tab?

0 Kudos
GKmieliauskas
Esri Regular Contributor

I haven't seen code like that. I know that there is possibility to change caption or image of existing button from code. All things with user interface you can access via  FrameworkApplication.GetPlugInWrapper. Try to investigate on that direction.

0 Kudos
hadric1209
New Contributor

Yeah. Found that method/property (FrameworkApplication.GetPlugInWrapper) but it is asking only for the id from the DAML file. We cannot provide the ID that is why we want to loop over the config.daml and look for it there using the caption (My Tab) then, append/add if not exist or update and add the group there.

0 Kudos