/Arcpy

ESRI Arcpy scripts.

Primary LanguagePython

Arcpy AddIns & Command Line Tools

ESRI Arcpy scripts for ArcGIS.

A collection of add-in and command line tools for map production and automation.

Add_Ins

  • Contains tools to record, restore, and reset layouts of data driven page (DDP) enabled mxds.
  • Records layout position, size, and extents of north arrows, scale bars/text, and data frames.
  • Saves data to a `.dbf` with specific name, which can be changed.

Annotation & Annotation_Stand_Alone

  • ExtentBoxes Tool to create bounding boxes (polygons) of ddp dataframe extents of on-map dfs. Used for index polygon for Tiled Annotation creation.
  • GenerateTiledAnno Automation of `TiledLabelsToAnnotation_cartography` tool that uses above generated boxes as index polygons.
  • Stand-alone script is the same tool as above but is run from the command line with syntax `python NAME_OF_SCRIPT.py`. Doesn't need ArcMap GUI and is therefore much fasterthan the above tools.

Layers

  • A method of programmatically saving and restoring layer symbology for a given ddp.
  • Saves layerfiles to a specific location named as `pageName_layerName_dataframeName.lyr`.

PDF_Export_Addin & PDF_Export_Stand_Alone

  • Buttons to automate pdf export with pre-defined parameters. Can be easily altered to allow different params.
  • Generates pdf name in the form `pageName_dpi_colorspace_orientation`.
  • Stand-alone script is the same tool as above but is run from the command line with syntax `python NAME_OF_SCRIPT.py DPI` where DPI is and integer representing the dots per inch of the exported pdf. Doesn't need ArcMap GUI and is therefore much faster than the above tools.

QuerySelection

  • On button press genterates definition query for layer of selected features. Simply select features you want to display for one layer, and press the button.
  • Select layer in table of contents and press clear selection button to clear the query for that layer.

ReplicateSD (Command Line Tool)

  • An automated way to replicate ArcSDE connected database to a local FGDB to improve performance.
  • Uses a list (`layerNameLst`) to control which files are copied. Can easily be altered to include all files on SDE.
  • Change databaseConnection variable to your .sde connection file.
  • Can be run by a task scheduler at regular intervals to keep data up-to-date.