ArcGIS Desktop Add-in Plug-in Development Series

Source: Internet
Author: User
ArcGIS Desktop Add-in Plug-in Development Series 1

Previous/next article 17:13:03/personal classification: ArcGIS Desktop

View (691)/comment (4) Add-in Concepts

ArcGIS 10 introduces several new and innovative features, making it easier to customize and expand ArcGIS desktop applications, including new desktop plug-in models. Add-in can be understood as a plug-in package that can contain a variety of UI and non-UI objects. The supported object types include ):

Category 1: Interaction

Buttons and tools:

Buttons and tools are simple controls that can appear in the toolbar buttons or in the case menu.

Combo box:

A combo box provides a drop-down list for a project. You can select an editable input area.

Multiple projects:

A multi-project is a set of menu items dynamically created at runtime. When a project that is useful in the multi-project menu cannot be determined, the running time or project needs to be modified based on the system status.

Dock window:

A floating or docked window is displayed on the ArcGIS desktop application. The window can be docked. You can use any filled content classification: charts, slides, videos, mini maps, or include other controls in the ESRI custom dialog box control. When it is attached to the development window that can be docked, it begins to appear, whether it will be quite controlled with other window groups that can be docked.

Application extension:

Application Extensions are used to coordinate activities between other components, such as buttons, tools, and dock windows, in one containing add-on. Application Extensions are typically used as an external entity with the storage status and are often used to listen for and respond to various activities exposed by the Host application. Application extension, which can be configured to automatically load or automatically start when loading their related applications; extension can also be configured to appear in the standard ArcGIS extension dialog box, for example, spatial analysis and network analysis.

Editor extension:

Editor extension allows you to directly edit your editing workflow by inserting the framework. Compared with the application extension, the extension editor add-on starts when the edit session is loaded (Edit> start editing ). You can customize your edit session behavior (for example, edit a listener event) by creating an editor extension.

Second Class: Container class

Toolbar:

The toolbar can carry buttons, tools, menus, toolbar, and combo boxes. As the menu, control, and toolbar appear from built-in sources, external sources, or both. When the toolbar can be configured to appear automatically, it is first added to the application, so that they have obvious users.

Tool Disk:

A tool disk provides a compact way to integrate a set of related tools. Displays commonly used tools and a toolbar with a small drop-down button. It is used to access other tools in the group. As in the menu, the toolkit palette appears from built-in sources, external sources, or both.

Menu and context menu:

A menu button, sub-, and multi-project drop-down list is proposed. Menu items can come from built-in sources, external sources, or both. Menus are usually hosted on the toolbar, but they may also have context (pop-up) menus and menu root independent.

These objects can be created by adding a new project wizard in the Visual Studio project. During the creation process, you must specify the attributes of the object, such as the title, icon, category, and prompt. Attributes that can be set for different types of objects are not exactly the same. These settings are static and saved in the XML file Config. esriaddparameters. High-level users can write and modify their own content.


To be continued ...... ArcGIS Desktop Add-in Plug-in Development Series 2

Previous/next article 13:46:36/personal classification: ArcGIS Desktop

View (1163)/comment (1)/score (0/0) Add-in development process

Use the New Project Wizard of Visual Studio and select the ArcGIS Add-in template provided by ESRI. These Add-in templates are for each application contained in ArcGIS Desktop. After the template is selected, the system requires us to immediately select the first object type added to Add-in. Then, if we need to Add more other object types to Add-in, we can create a new object through the Add new Project Wizard.

 

 

The project structure of Add-in is very simple and clear. The project contains a Config. the XML file of esriaddtables and the object code files that have been added to the project, such as the Command object and Tool Object. Note that the Dockable Windows object is a custom UI object, in addition to its code file, you can also see its design-time program. The programming experience is consistent with that of WinForm. In addition to the above, it also contains an Images folder to save the Images used in the project, such as the Command icon.

When writing code to implement the logic of custom objects, we must know some built-in objects that can help us compile secure code.

One of the built-in objects is the ArcGIS Desktop program object corresponding to our project. For example, if we are currently developing an ArcMap Add-in, in our project, there will be a built-in static class named ArcMap, which contains some static objects, such as Application, Document, DockableWindowManager, and Events, through these objects, we can easily obtain Map document instances containing Add-in the code, and then obtain core programming objects like Map.

Another built-in object is ThisAddin. Through this object, we can obtain some metadata information of the plug-in, such as the plug-in name and description. In addition, this object also contains an IDs object, this object records the progids of all objects contained in the current project. With these progids, we can easily create or find the corresponding objects. This mechanism is actually consistent with the object creation mechanism of COM.

After the program is compiled, it will generate a file with the suffix esriaddin, which is a zip file. After decompression, we know that it contains a Config. xml file, an Install Folder (which is the dll file of our plug-in) and an Images folder. By default, if you run a project in Visual Studio, the plug-in will automatically install the corresponding ArcGIS Desktop Application and start it. If no, You can manually set the debugging option for the project properties by starting an external Program. The path settings are as follows: C: \ Program Files \ ArcGIS \ topics top10.0 \ Bin \ ArcMap.exe.

 

 

 

The deployment of Add-in is also very simple. You can copy the compiled esriaddin file to the machine that has installed ArcGIS Desktop to be deployed, or send it as an email attachment to others. Double-click the esriaddin file on the computer where the plug-in is deployed. The Add-in installation interface is displayed, allowing you to view some metadata of the plug-in, such as the author, whether the plug-in has a digital signature, then let the user decide whether to install the plug-in. To install the plug-in, you do not need to restart any ArcGIS Desktop application. After installation, you can use the Add-in Manager of the corresponding ArcGIS Desktop Application to view the installed Add-in, or uninstall it.

Some Add-in objects, such as Command, Tool, and Toolbar, must be customized and added to the interface through the Customize window. To load the Extension object, you must check the Extensions window to load the object.

 

 

ArcGIS Desktop Add-in Plug-in Development Series 3

Previous/next article 13:50:53/personal classification: ArcGIS Desktop

View (482)/comment (0)/score (0/0)

Currently, many basic basemap maps are cached in slices. When we use them In ArcMap, we often find that the scale-level Scaling slider similar to ArcGIS FlexViewer or Google map is missing, although ArcMap supports re-sampling this type of map layers for non-hierarchical scaling, this experience is inconsistent with our webpage access operations, customers often need to click the Zoom to Nearest Cache Resoulution button to adjust the scale. In order to provide customers with consistent experience and ease of use. We use the latest Addin development plug-in template of ArcGIS Desktop 10 to customize a scale-out plug-in for the slice map service layer.

The Addin project contains a custom Command object and a custom DockableWindow object.

The scale level is automatically generated after the layer is set. The floating compact mode is supported.

The download path of Add-in is:

Http://www.arcgis.com/home/item.html? Id = ae10e3a5b5ec4078829fbfb808fcb887

The source code download path is:

Http://resources.arcgis.com/gallery/file/arcobjects-net-api/details? EntryID = CE577CF2-1422-2418-A0C3-C4E87F7E6FB5

ArcGIS Desktop Add-in Plug-in Development Series 4

Previous/next article 13:39:34/personal classification: ArcGIS Desktop

View (897)/comment (1)/score (0/0)

 

Advanced topic

 

Delayed Loading

By default, an assembly containing Add-in is loaded to an application by clicking a menu or a project (such as a button or command) on the toolbar, the advantage of this is that it saves the memory space used by the application. If you want to control whether an object can be clicked, you need to set its Enable attribute in the OnUpdate event of the button or command object, and add the onDemand attribute in the corresponding XML section in the corresponding esriaddtasks file, and set it to false, so that Add-in can be loaded immediately after the application is started, and the OnUpdate event is triggered.

 

File structure

Add-in activity, that is, the compiled dll and some satellite assembly will be put in the Install Folder in THE esriaddin compressed package. When Add-in is started for the first time, the system will automatically extract the contents of this folder and place it in a system directory.

Vista/7: C: \ Users \ <username> \ AppData \ Local \ ESRI \ topics top10.0 \ AssemblyCache

XP: C: \ Documents ents and Settings \ <username> \ Local Settings \ Application Data \ ESRI \ topics top10.0 \ AssemblyCache

When we delete Add-in through Add-in Manager, the preceding directory is automatically deleted.

For some images used by Add-in, we can set the reference path in the esriaddrule configuration file. The path is a relative path, and the root directory is our esriaddin compressed file.

If we need to add some data or other files to the esriaddin compressed file, we can set the copy to output directory attribute of these resources to always copy.

 

Registry

On a computer installed with ArcGIS Desktop, the Windows registry contains several registration keys for the Add-in control.

Path HKEY_LOCAL_MACHINE \ SOFTWARE \ ESRI \ topics top10.0 \ Settings:

The registration key BlockAddins can be set to multiple values:

0: Allow all Add-ins to be loaded.

1: Allow loading signed Add-ins.

2: only the Add-ins provided by ESRI can be loaded.

3: only the Add-ins provided by ESRI can be loaded and installed in the specified directory. The directory can be specified through the registry path HKEY_LOCAL_MACHINE \ SOFTWARE \ ESRI \ topics top10.0 \ Settings \ AddInFolders.

4: No Add-ins can be loaded.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.