Extension class
Functions of the extension class
The extension class consists of one propery and many functions which provide access to events related to the ArcGIS for Desktop application.
Property | Explanation |
---|---|
enabled | This property returns the state of the extension. If it is set to True, the extension is started. When this property is set to False, the extension is shutdown. This property can be changed in any of the functions listed below. |
Function | Explanation |
---|---|
__init__ (self) | Python built-in function to define intial variables. |
startup(self) | Occurs at the startup of the application (for example, ArcMap). |
activeViewChanged(self) | Occurs when the active view is changed. The active view changes when a data frame is added or removed and when changing from data view to layout view. |
mapsChanged (self) | Occurs only when a data frame is added or removed. |
newDocument (self) | Occurs anytime a new document is created. |
openDocument (self) | Occurs anytime a document is opened. |
beforeCloseDocument (self) | Occurs before a document is closed. |
closeDocument (self) | Occurs when a document closes. |
beforePageIndexExtentChange (self, old_id) | Occurs before the data-driven page extent is changed. This happens after you click to navigate to the next data-driven page and before the extent changes. The old_id represents the current page ID before it changes. |
pageIndexExtentChanged (self, new_id) | Occurs when the data-driven page extent is changed. This happens once the extent of the data-driven next page changes. The new_id represents the new page ID. |
contentsChanged(self) | Occurs when the contents of the view changes, such as changing the properties or symbology of a layer. |
spatialReferenceChanged(self) | Occurs when the spatial reference of the data frame is changed. |
itemAdded(self, new_item) | Occurs every time a new layer is added or when a new element is added to the page layout. Elements include graphics and data frames. The new_item will return None for items such as images and graphics. |
itemDeleted(self, deleted_item) | Occurs every time a layer is removed or when an element is deleted from the page layout. Elements include graphics and data frames. The deleted_item will return None for items such as images and graphics. |
itemReordered(self, reordered_item, new_index) | Occurs when layers in the table of contents are reordered and when new layers are added. This also occurs when changing the order of graphics in the page layout. For example, sending a graphic to the back or to the front. This does not occur when graphics are reordered in the map view. |
onEditorSelectionChanged(self) | Occurs whenever the feature selection changes during an edit session. |
onCurrentLayerChanged(self) | Occurs whenever the current layer changes during an edit session. |
onCurrentTaskChanged(self) | Occurs whenever the current task changes during an edit session. For example, this occurs when changing from a construction tool to the reshape feature tool. |
onStartEditing(self) | Occurs whenever an edit session is started. |
onStopEditing(self) | Occurs whenever an edit session ends. |
onStartOperation(self) | Occurs whenever an edit operation starts. |
beforeStopOperation(self) | Occurs before the edit operation stops. This provides an opportunity to perform preliminary analysis on changes that occurred inside the edit operation before committing that operation to the geodatabase. |
onStopOperation(self) | Occurs when the operation is successfully completed. |
onSaveEdits(self) | Occurs whenever the save edits command is executed in the Editor. |
onChangeFeature(self) | Occurs whenever a new feature is changed. |
onCreateFeature(self) | Occurs whenever a new feature is created. |
onDeleteFeature(self) | Occurs whenever a feature is deleted. |
onUndo(self) | Occurs whenever an edit operation is undone. For example, if a feature is moved and Undo is called, the onUndo is fired. |
onRedo(self) | Occurs whenever an edit operation is redone. For example, if a feature is moved and Undo and Redo are called, the onUndo and onRedo are fired. |