How to add a button to another addins group?

1184
2
Jump to solution
01-22-2018 07:22 AM
RichardReinicke
Occasional Contributor II

Hi,

we want to create an add-in that extends another add-in. To be precise we want to add a new button to an existing  group defined in the first add-in. We still use SDK 1.3 and ArcGIS Pro 1.4 and don`t want to migrate at the moment.

I found documentation for version 2+ so I`m not sure if this can be applied to our tool.

Our first Add-Ins Config.daml:

  <modules>
    <insertModule id="ArcGIS_Pro_AddIn_MaxHonsell_II_Module" className="Module1" autoLoad="false" caption="Module1">
      <groups>
        <group id="ArcGIS_Pro_AddIn_MaxHonsell_II_Group1" caption="Messschiff" appearsOnAddInTab="true">
          <!-- host controls within groups -->
          <button refID="ArcGIS_Pro_AddIn_MaxHonsell_II_MainPanel_ShowButton" size="large"  />
        </group>
      </groups>
      <controls>
        <!-- add your controls here -->
        <button id="ArcGIS_Pro_AddIn_MaxHonsell_II_MainPanel_ShowButton" caption="Hauptmodul" className="MainPanel_ShowButton" loadOnClick="true" smallImage="Images\MaxHonsell32.png" largeImage="Images\MaxHonsell64.png">
          <tooltip heading="Starte Basis Add-In">Öffnet bei Klick das Steuerfenster des Max Honsell Basis Add-Ins<disabledText /></tooltip>
        </button>
      </controls>
      <dockPanes>
        <dockPane id="ArcGIS_Pro_AddIn_MaxHonsell_II_MainPanel" caption="Max Honsell Add-In" className="MainPanelViewModel" dock="group" dockWith="esri_core_contentsDockPane">
          <content className="MainPanelView" />
        </dockPane>
      </dockPanes>
    </insertModule>
  </modules>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

And our second Add-In Config.daml:

  <modules>
    <insertModule id="ArcGIS_Pro_AddIn_MaxHonsell_GPS_Module" className="GpsModule" autoLoad="false" caption="GPS Modul">
      <controls>
        <button id="ArcGIS_Pro_AddIn_MaxHonsell_GPS_ShowGpsPanelButton" caption="ShowGpsPanelButton" className="ShowGpsPanelButton" loadOnClick="true" smallImage="Images\MaxHonsellGps32.png" largeImage="Images\MaxHonsellGps64.png">
          <tooltip heading="Starte GPS Add-In">
            Öffnet bei Klick das Steuerfenster des Max Honsell GPS Add-Ins<disabledText />
          </tooltip>
        </button>
      </controls>
    </insertModule>
    <updateModule refID="ArcGIS_Pro_AddIn_MaxHonsell_II_Module">
      <groups>
        <updateGroup refID="ArcGIS_Pro_AddIn_MaxHonsell_II_Group1">
          <insertButton refID="ArcGIS_Pro_AddIn_MaxHonsell_GPS_ShowGpsPanelButton" insert="after" placeWith="ArcGIS_Pro_AddIn_MaxHonsell_II_MainPanel_ShowButton" size="large" />
        </updateGroup>
      </groups>
    </updateModule>
  </modules>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Am I missing something? Any help would be very appreciated!

Richard

1 Solution

Accepted Solutions
SteveVan_Esch
Esri Contributor

Hi. Can you try adding a dependencies element under your AddInInfo element. For the dependency name use the other add-in's ID. This will tell the add-in processor to process add-in B first.

Add-IN A (with module id="ArcGIS_Pro_AddIn_MaxHonsell_GPS_Module"):

  <dependencies>
    <dependency name="{6c2ad456-410f-4fe2-8df3-c9a974ef98c0}" />
  </dependencies>

Add-In B ( with module id="ArcGIS_Pro_AddIn_MaxHonsell_II_Module"):

<ArcGIS defaultAssembly="WizardSample.dll"
        defaultNamespace="WizardSample"
        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:/ArcGIS/bin/ArcGIS.Desktop.Framework.xsd">
  <AddInInfo id="{6c2ad456-410f-4fe2-8df3-c9a974ef98c0}" version="1.0" desktopVersion="2.0.8533">
    <Name>WizardSample</Name>
    <Description>WizardSample description</Description>
    <Image>Images\AddinDesktop32.png</Image>

View solution in original post

2 Replies
SteveVan_Esch
Esri Contributor

Hi. Can you try adding a dependencies element under your AddInInfo element. For the dependency name use the other add-in's ID. This will tell the add-in processor to process add-in B first.

Add-IN A (with module id="ArcGIS_Pro_AddIn_MaxHonsell_GPS_Module"):

  <dependencies>
    <dependency name="{6c2ad456-410f-4fe2-8df3-c9a974ef98c0}" />
  </dependencies>

Add-In B ( with module id="ArcGIS_Pro_AddIn_MaxHonsell_II_Module"):

<ArcGIS defaultAssembly="WizardSample.dll"
        defaultNamespace="WizardSample"
        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:/ArcGIS/bin/ArcGIS.Desktop.Framework.xsd">
  <AddInInfo id="{6c2ad456-410f-4fe2-8df3-c9a974ef98c0}" version="1.0" desktopVersion="2.0.8533">
    <Name>WizardSample</Name>
    <Description>WizardSample description</Description>
    <Image>Images\AddinDesktop32.png</Image>

RichardReinicke
Occasional Contributor II

Hi Steve, thank you for the quick answer! It solved my problem.

0 Kudos