ArcGIS add-in--Automatically save edits

Source: Internet
Author: User

requirements : Due to the first time using the ArcGIS editor is not accustomed to the large amount of data caused by the regular program is not responsive, computer power outages and other factors, resulting in the compilation of data is not saved, affecting the production efficiency, I based on grass color Chengzhe blog, summed up the automatic saving editing implementation method.

Analysis : Auto-save, used is definitely a timer, is generally used with micro-software timer control, its elapsed event refers to when the interval occurs (specified by the Interval property), so the basic steps are:

(1) declaring variables;

(2) Write the elapsed event, and write the automatic saving function in the event;

(3) in the onclick call elapsed event, trigger timer.

To save edits automatically, get the editor, know the current workspace, and then call the Stopediting and Startediting methods. The use of these specific classes and methods has to be reviewed in the ESRI Help documentation.

The thing to note here is the editor's acquisition, which can be consulted: http://www.cnblogs.com/liweis/p/4582176.html, but the question I want to describe now is, get the code to write where the problem is. By default, the new AddIn program, which creates a new ArcMap static class in Config.designer, gets the application, Document, ThisApplication, and Gethook methods in the class. Dockablewindowmanager, events five objects, which of course we can add an editor object to it as needed. But if I add the AddIn component to the program again, it overrides the class to the default state, which was not previously customized. Cause: Any content that modifies Config.esriaddinx,config.designer.cs will revert to the default, and the Copy Local property referencing ArcGIS Desktop add-in will become F, so it is recommended that Do not put these customizations in the Config.Designer.cs.

Next, I want to put this button function on the toolbar and bring up the tool bar. The internet did not search for such an example, their own groping, and finally realized: in fact, it is very simple, add new items on the existing basis, select Add-in Command Container, select the toolbar in the Popup Wizard, set the toolbar name (C aption), add entries, Select the button you have written.

Let's take a look at its tag code, which is very clearly understood.

ArcGIS add-in--Automatically save edits

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.