different add-ins on same custom ribbon tab

1412
3
Jump to solution
12-28-2016 08:38 AM
Highlighted
New Contributor II


I'm creating a series of Add-ins to place on my own custom ribbon tab. Only the first Add-in is showing up on my tab. A second one, created as an independent project, doesn't work despite having the same (or different) module id, module classname and tab id. What are the requirements to put different independent Add-ins on the same custom tab? Do they have to be created in the same solution? #arcgisprosdk#creating .net add-ins

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
by Esri Regular Contributor
Esri Regular Contributor

Hi Andres,

 Yes, the reference document is here:

https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#introduction-to-daml-desktop-appli...

I think the syntax to add your button to an already existing group goes like this:

<updateModule refID="module id of your first add-in">
  <groups>
    <updateGroup refID="group id of your first add-in that you like to add your button">
      <insertButton refID="id of the new button defined in this add-in"></insertButton>
     </updateGroup>
  </groups>
</updateModule>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 I also just remembered a way to debug the 'combined' daml once you published your add-in.  You can use the following command line:
https://github.com/esri/arcgis-pro-sdk/wiki/ProGuide-Command-lines-switches-for-ArcGISPro.exe#view-t...

View solution in original post

3 Replies
Highlighted
by Esri Regular Contributor
Esri Regular Contributor

Hi Andres,

 First you need to make sure all your add-ins are working properly, and you can test this by clearing your add-ins (from the well known folder location) before you rebuild each add-in separately and then test it.  Next you need to make sure that you know the add-in loading sequence.  Currently the loading sequence is determined by the value of the "id" attribute under the "AddInInfo" tag in the "config.daml" file.  In my example below that value starts with f0f7...

<ArcGIS defaultAssembly="test1.dll" defaultNamespace="test1" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd">
  <AddInInfo id="{f0f70f07-0579-4df7-9a47-570c46c3aa5b}" version="1.0" desktopVersion="1.3.0">
    <Name>test1</Name>
    <Description>test1 description</Description>
    <Image>Images\AddinDesktop32.png</Image>
    <Author>Wolfgang</Author>
    ...‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 The lower "id" values are loaded first, so if I have a second add-in with a value that starts with b0f... which means that my "test2" add-in is always loaded first because of it's lower "id" value.  Note: if you want to change the "id" value you have to change the same value in "AssemblyInfo.cs" as well.  Because test2 is loaded first test2 elements are the only elements I see on the newly added tab.  When test1 is loaded it is trying to add an already existing tab and consequently none of the test1 elements are seen on the UI.

<ArcGIS defaultAssembly="Test2.dll" defaultNamespace="Test2" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd">
  <AddInInfo id="{b0f89d8e-66fb-4509-bcb1-14d7fe0b8eba}" version="1.0" desktopVersion="1.3.0">
    <Name>Test2</Name>
    <Description>Test2 description</Description>
    <Image>Images\AddinDesktop32.png</Image>
    <Author>Wolfgang</Author>
    ...

 So now I know that my test2 add-in loads first, therefore I don't change anything in test2.  However, test1, which is loaded second, needs to be modified: Instead of creating a tab and adding my 'group' to that tab I now use the "updateModule" tag in my daml to make an "update" to my "test2" module's UI.  We have a sample that shows how to update existing items on the ribbon here: WorkingWithDAML.

 In short I made the following addition at the end of my "test1" "config.daml" file:

      ...
      </controls>
    </insertModule>
    <updateModule refID="Test2_Module">
      <tabs>
        <updateTab refID="test_Tab">
          <insertGroup refID="test1_Group1" insert="before"></insertGroup>
        </updateTab>
      </tabs>
    </updateModule>
  </modules>
</ArcGIS>

 The DAML change I made here updates my Test2_Module's UI (test2 is my add-in that is loaded first) by adding a new group to the already existing tab called test_Tab.  So now my two add-ins appear on the same Test ribbon as can be seen here:

Two add-in on the same tab

Highlighted
New Contributor II

Thank you Wolfgang. I checked your code and the WorkingWithDALM example, but both are different cases to what I'm trying to do. I'm using:

...

      </controls>
    </insertModule>
    <updateModule refID="MyAddin1_Module">
      <tabs>
        <updateTab refID="MyAddins_Tab">
            <updateGroup refID="Layer_Group"></updateGroup>
        </updateTab>
      </tabs>
    </updateModule>
  </modules>
</ArcGIS>

to try to have a second button within the same group of the first app. I made sure both were working and that the first one loads first. The second Add-in has the same module, tab and group id as the first one. What is wrong here? Is there a reference document on the config.daml file?

Reply
0 Kudos
Highlighted
by Esri Regular Contributor
Esri Regular Contributor

Hi Andres,

 Yes, the reference document is here:

https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#introduction-to-daml-desktop-appli...

I think the syntax to add your button to an already existing group goes like this:

<updateModule refID="module id of your first add-in">
  <groups>
    <updateGroup refID="group id of your first add-in that you like to add your button">
      <insertButton refID="id of the new button defined in this add-in"></insertButton>
     </updateGroup>
  </groups>
</updateModule>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 I also just remembered a way to debug the 'combined' daml once you published your add-in.  You can use the following command line:
https://github.com/esri/arcgis-pro-sdk/wiki/ProGuide-Command-lines-switches-for-ArcGISPro.exe#view-t...

View solution in original post