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

209
2
Jump to solution
04-17-2024 09:15 AM
BobCarberry3
New 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
2 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
New 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!