Select to view content in your preferred language

Make custom Add-In tabs visible to certain ArcGIS Pro Projects

963
4
Jump to solution
04-17-2024 09:15 AM
BobCarberry3
Emerging Contributor

We have several custom Add-ins that are used in our organization.  Most of these are layer based, such as editing a certain layer.  For example, we have an Add-in used to edit our zoning layer.  Along with this Add-in is an ArcGIS Pro project that is only used to edit the zoning  (contains the zoning layer, etc.).  We also have an Add-in that is used to edit project boundaries for new subdivisions, again, this Add-in is used in a different ArcGIS Pro Project that's used to edit subdivision boundaries .  Each of these Add-ins are set up to have their  own tabs (not in the Add-n tab).  My question is, is there a way to make these Add-in tabs project specific?  Like when you open the zoning Pro project, you only see the zoning Add-tab and not the flood layer Add-in tab and vise versa?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
UmaHarano
Esri Regular Contributor

Hi

You can use states and conditions to accomplish. Consult: ProGuide: Code Your Own States and Conditions 

I have attached an addin that demonstrates this:

  • In the DAML, I have created a new condition usa_population_condition that is linked to the usa_population_state state.
  • The tab element has this condition value added to the condition attribute.
  • In the Module class, I listen to the ProjectOpenedEvent event and activate the state using FrameworkApplication.State.Activate method.

Please note how I have set the autoLoad attribute in DAML to true so that the addin code launches when Pro loads and a project opens.

Thanks

Uma

 

View solution in original post

0 Kudos
4 Replies
UmaHarano
Esri Regular Contributor

Hi

You can use states and conditions to accomplish. Consult: ProGuide: Code Your Own States and Conditions 

I have attached an addin that demonstrates this:

  • In the DAML, I have created a new condition usa_population_condition that is linked to the usa_population_state state.
  • The tab element has this condition value added to the condition attribute.
  • In the Module class, I listen to the ProjectOpenedEvent event and activate the state using FrameworkApplication.State.Activate method.

Please note how I have set the autoLoad attribute in DAML to true so that the addin code launches when Pro loads and a project opens.

Thanks

Uma

 

0 Kudos
BobCarberry3
Emerging Contributor
It looks like this is going to work out. I asked this question at the Developer Summit and they alluded to this solution but I couldn't get it to work. Your example made sense and I got it to work. Thanks!
RileyAnderson
New Contributor

Hi Uma,

Is it possible to move an addin tab to the first tab (i.e. ahead of all other built-in tabs, between the Project and Map tab)? 

 

Thank you!

0 Kudos
Ay-Ay-Ron
New Contributor

Hi Riley, you've probably figured this out, but I've done this by using (in your case):

placeWith="esri_mappingTab" insert="before" 

 <tabs>
   <tab id="clsArcProMappingTools_Tab1" caption="Tab1" keytip="" insert="before" placeWith="esri_datasourcesraster_imageryCoreTab">
    <group refID="clsArcProMappingTools_Group1" />
    <group refID="clsArcProMappingTools_Group2" />
    <group refID="clsArcProMappingTools_Group3" />
   </tab>
 </tabs>

in the config daml. Not sure if that's the refID for the mapping tab, but if you insert the correct one it'll place it before the Map tab on the ribbon. The example above places it before the Imagery tab