Wednesday, April 28, 2010

Install Non-Packaged 3rd Party GIS Plugins

Many third party GIS plugins have been neatly packaged into .dll files or batch files (ET GeoWizards, arcscripts.esri.com/resources.arcgis.com, etc.) that can be installed or imported into ones software interface in one step.  This easy method is not always available.  Below is an example of how to install a non-packaged plugin.  For further explanation on any of these steps, refer to a previous article on GIS Desktop Customization.

I'll use my Attribution Assistant in the following example - Download the installation package (12 kb)

What's included:
  • _Attribution_Icon.bmp is a graphic to use as the icon that will be used to launch the tool from the ArcMap interface
  • frmAttribution v2.0.frm is the form that will be imported into ArcMap.  The source code is stored in this file, and can be viewed when opened by a text editor.  Do not change any of these settings via text editor.
  • frmAttribution v2.0.frx a VB binary file that accompanies the .frm file that holds graphics and other information that will be used by the application
  • Installation instructions.txt is a "Readme" text file with information about the plugin

Install:
  • Open ArcMap
  • Open the Visual Basic Editor from Tools menu under Tools :: Macros :: Visual Basic Editor
  • Locate the Project Explorer (see below).  If you want the tool to be available every time you open ArcMap, you'll import the plugin under the Normal.mxt branch.  Otherwise, installing the application under the Project branch in the Project Explorer will only allow access to the tool when working under a specific ArcMap project (a saved .mxd file).
Undocked Visual Basic Project Explorer
  • Right click on the Normal branch and choose Import File so the plugin will be available every time ArcMap is opened.  Navigate to where the install package was unzipped, choose frmAttribution v2.0.frm and click Open.  Expand Normal and Forms to view the new form (see below), otherwise close the Visual Basic Editor.
 frmAttribution successfully imported
  • Back in ArcMap open the Customize dialog via Tools :: Customize
  • Navigate to the Commands tab
  • Ensure that the Save in: setting is set to Normal.mxt to ensure that the tool will be available every time ArcMap is opened
  • Scroll to the bottom of the Categories menu and select [ UI Controls ]
  • Click the New UIControl button, choose UIButton Control
  • Slow double click on the new control probably named Normal.UIButtonControl1 in the Commands list and rename it "Attribution_Launch."  When you press enter it will automatically rename itself "Normal.Attribution_Launch"
  •  Drag the new control onto the ArcMap interface
  •  Change the button face icon: With the Customize dialog still opened, right click on the icon that was just dropped onto the ArcMap interface and under the Change Button Image sub-menu, choose Browse
  • Navigate to the directory where the installation package was unzipped, choose _Attribution_Icon.bmp and click Open
  •  With the Customize dialog still open, right click on the new button on the ArcMap interface one more time and choose View Source.  The Visual Basic Editor will open, and will automatically open the ThisDocument code under Normal.mxt, with some code written for you (don't worry if you don't completely understand this part, just follow the directions to get through it)
  • Copy and following line and paste it into the Attribution_Launch_Click subroutine:
    Normal.frmAttribution.Show (vbModeless)
    It should look like the following:
Private Sub Attribution_Launch_Click() 
    Normal.frmAttribution.Show (vbModeless)
End Sub

  • Close the Visual Basic Editor when finished and you're good to go!  Click on your new button to launch the newly imported ArcMap plugin!

3 comments:

Anonymous said...

Wow this was extremely helpful, thanks!

mens ed pills said...

It's the best time to make some plans for the future and it's time to be happy. I've read this post and if I could I want to suggest you few interesting things or tips. Perhaps you could write next articles referring to this article. I wish to read even more things about it!

erectile said...

I've been browsing online more than 4 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the net will be a lot more useful than ever before.