Can you create a multi-level dropdown button to organize and select features?

1147
11
10-27-2020 12:27 PM
DerekSalinas
New Contributor III

Hello All,

Within ArcMap, we could create a custom button, via python, to act as an organized catalog to add features to a map from a geodatabase. All the menu items were neatly organized depending on the category of the feature. This was a nice way to present the data because there is a lot to organize. In addition it would call up the feature class from a geodatabase and utilize the symbology from a specified layer.  

Original Addin

Now i have created a very basic button in ArcPro to call up features from a specified geodatabase, however i can't find any information on how to organize the buttons into further dropdown categories or utilize layer symbology. 

 \

Any help on code or a point in the right direction would be incredibly helpful and I appreciate your time. 

Thanks,

Derek Salinas

0 Kudos
11 Replies
NarelleChedzey
Esri Contributor

Derek

<group id="test" caption="Test">
  <insertButtonPalette refID="esri_task_insertMenu" size="middle"/>
</group>

and 

<group id="test" caption="Test">
  <buttonPalette refID="esri_task_insertMenu" size="middle"/>
</group>

are exactly the same.  You can do either.  Mostly we use the tag without the insert prefix. Sorry for the confusion. 

re the ids of "esri_task_xxx" vs "esri_tasks_xxx".  This was a typo in our source code with respect to consistency.  Good pickup. 

When you define a button / tool / menu / etc.  the key attribute is "id".  Internally at Esri we use a particular naming convention of "esri_(modulename)_xxx".  We recommend a similar pattern for add-in developers of (moduleName)_xxx, but the id string can be anything. The important thing is it must be unique within your module. 

Any item in groups, tabs, menus  etc that use a "refID" attribute must have a corresponding entry in the <controls> section of the combined ArcGIS Pro daml file that defines that id.   In this way, you have the ability to reference any of our Esri daml buttons, tools, menus etc in your add-in not just those defined by you. 

Regards

Narelle

0 Kudos
DerekSalinas
New Contributor III

Wow! 

That was all a major help and it worked out perfectly. Thank you so much for taking the time.

Regards,

Derek

0 Kudos