Using a very simple Perl script, I extracted the information.
Here are the results.
In the future, I may link the actual sample to each script.
For now, read this and/or save a copy to your local
machine. When you need it, you'll have it.
Share and enjoy.
ClipThm.ave
Name: View.ClipThemeOnTheme
Title: Clips one line or polygon theme using another polygon theme
Description: Clips one theme by a selected polygon theme, returning
a new shapefile with the clipped features and their attributes.
ddecress.ave
Name: DDECreateSpreadsheet
Title: Use DDE to create a Spreadsheet in Excel
Description: Creates a DDE Conversation with Excel and populates an
Excel spreadsheet using information from the specified fields for the
selected rows in a Table.
DDE (Microsoft's Dynamic Data Exchange) provides a mechanism for
transferring data between applications. A DDE exchange is called a
conversation. In a conversation the client application initiates
requests and the server application responds. The conversation is
identified by the server name and a topic name. The server name is
usually the name of the application itself. Most applications support
the system topic name. The ArcView DDEClient can initiate one of several
standard transactions; execute, request, and poke.
In this example the ArcView DDEClient establishes a conversation with an
Excel server using the System topic. The ArcView client uses Execute to
create a new spreadsheet, Request to get information about the spreadsheet,
and Poke to populate the spreadsheet with information from the selected
rows using the contents of the specified fields. Though this example uses
Excel, other applications may have similar DDE functionality.
ddesysit.ave
Name: GetDDESystemItems
Title: Demonstrates a DDE conversation with Excel
Description: A demonstration script which initiates a DDE conversation
with Excel through Excel's System topic, and retrieves a list of valid
items within the topic. Information about the chosen item is returned.
DDE (Microsoft's Dynamic Data Exchange) provides a mechanism for
transferring data between applications. A DDE exchange is called a
conversation. In a conversation the client application initiates
requests and the server application responds. The conversation is
identified by the server name and a topic name. The server name is
usually the name of the application itself. Most applications support
the system topic name. The ArcView DDEClient can initiate one of several
standard transactions; execute, request, and poke.
In this example the ArcView DDEClient establishes a connection with an
Excel server. The ArcView DDEClient uses Request to return a list of
valid items for the System topic, and uses the chosen item in another
Request to get additional information.
grdmaker.ave
Name: View.GridMaker
Title: Creates arbitrary grid(vector)shapefile
Description: This script is attached to a tool. When you drag
a rectangle with the tool, you are then prompted for how many rows and
columns you want in the grid. Then you are asked for the name of a
shapefile to create, and the grid is created. One attribute is added to
this grid shape theme, a label, that is "A1 A2 B1 B2...." as you might
see on an index map. The labeling starts at the upper left.
The grid is added to your current view as a theme called "Grid" with
hollow fill pattern and thick (thickness 2) black lines. You are
prompted as to whether you want to label the grid. If you say yes, it
will put the labels in the grid box using the current textsymbol.
GrExtrct.ave
Name: Spatial.ExtractByGraphic
Title: Extract grids by a graphic
Description: This script extracts a new grid by clipping from an
overlaying graphic.
imgext.ave
Name: View.RedefineImageExtent
Title: Redefines the extent of a image theme
Description: Sets an image map extent to the user specified rectangle.
This allows the 'moving' of images to a new coordinate space on the View.
jnlnktbl.ave
Name: Table.JoinOrLink
Title: Joins or Links two tables
Description: Shows how to Join or Link two tables. Both Join and Link
require the specification of a common field from each table (common in
value, not name) upon which the operation will be performed.
A Join assumes a one to one condition, i.e. there is a one to one
relationship between the two tables based upon the contents of the Join
field. The fields of both Tables will merge into a single document.
A Link is used when there is a one to many relationship. The Tables are not
merged, but selecting a row in the origin Table will select multiple records
in the linked Table.
mrgthems.ave
Name: View.MergeThemes
Title: Merges two feature themes
Description: Merges the selected themes into a single theme. A new
shapefile is created which combines the shapes and attributes of the
active themes. The themes to be merged should have the same set of
attributes (fields). Only the fields from the first active theme are
preserved in the output theme.
tocfont.ave
Name: View.SetTOCFont
Title: Sets the TOC Font
Description: This interactive script allows you to change the font
family, style, and size used in a View's TOC. This script can be
attached to a click event on a control in the View's DocGUI. Note
that the font changes are applied to ALL views currently in the
project, and any views created after the script is run.
The font changes are NOT maintained between ArcView sessions. You
could store the text symbol as an object tag on the project, and
restore the symbol when the project is first opened. Adding this
request to the bottom of this script will store the text symbol
as an object tag on the project:
- av.GetProject.SetObjectTag(TOCFont)
Restore the symbol by getting the object tag and issuing the request,
TOC.SetDefaultSymbol(aSymbol). Include this in a startup script, or in
an script run by the user. When using this method views must be reopened
to see the TOC drawn with the new font.
addcolor.ave
Name: Graphic.AddColorToColorPalette
Title: Adds color from selected graphic to color palette
Description: Run this script from a button or menu choice in either
a DocGUI that supports view or layout documents. The idea behind this
script is to allow you to create a custom color and then be able to
add it to the color palette. Since ArcView does not directly support
this, this script is necessary.
Place a graphic in either a view or layout and then change its symbol's
color to the custom color of your choosing. Then while this graphic
is selected, run this script. The color you have assigned to the graphic
will be captured and added to the current color palette.
addconv.ave
Name: ADD2Shapefile
Title: Converts ARC/INFO .ADD file to Shapefile
Description: Converts an ARC/INFO coverage with an .ADD (address) file,
to a shapefile with address elements. Only the address attributes are
included in the conversion. Add the coverage to a view and make it the
active theme, then run this script.
Substitution and place name aliases for addresses are converted to
shapefile records. A new table is created to contain the address alias
(.ADD) records. All of the current "good" addresses are assumed to be in
the .ADD file. It is also assumed that the structure or sort order of
the .ADD file has not been changed from how ARC/INFO created it.
To export more or all the fields to the shapefile, modify the code below
to make the fields visible (search for the SetVisible request).
addgshp.ave
Name: View.AddShape
Title: Creates GraphicShapes and Symbols for a View
Description: A graphic circle, 2 boxes, a line and point are created and
added to the graphics list of the current view. Different symbols are
assigned to each graphic object.
Each View has a GraphicList which is a list of all the Graphics
associated with a View. The graphics on the GraphicList are persistent
and will be saved with a View. New graphics you create are added to
the GraphicList.
To create graphic objects, the mathematical shape must be created first.
GraphicShapes can then be created from these objects and added to the
GraphicList. Each graphic has a Symbol which determines how it will be
drawn on the screen. Subclasses of Symbol represent specific styles, such
as solid fills, dashed lines, etc.
addrecno.ave
Name: View.AddRecNumFieldToThemes
Title: Adds a Recno attribute to all active FTabs
Description: Adds a Recno attribute to Ftab of all active themes,
if it doesn't exist, and populates it. If it already
exists, the user is prompted as to whether they want
it's values updated or not.
addtheme.ave
Name: View.AddTheme
Title: Adds a theme to a view
Description: A sample script which demonstrates the procedure used
to add a new theme to the current view, create a unique classification
legend, and draw it. In this example an ARC/INFO coverage containing
polygon topology is added to the view. A legend of unique classifications
is created based on the 'Name' field found in the coverage feature attribute
table and the theme is drawn.
addtmenu.ave
Name: Project.AddToolMenu
Title: Adds a ToolMenu (pull-down tool) to a DocGUI
Description: Adds a ToolMenu to the docGUI chosen from the list of DocGUIs
in the current project. The user is prompted for the number of tools to
place in the ToolMenu, and the ToolMenu is added to the ToolBar. Use
the Customize Dialog Box to specify the properties of the component tools
and to move the ToolMenu to the desired location.
addxycoo.ave
Name: View.AddXYCoordToFTab
Title: Adds X and Y coordinates of features to Attribute Table
Description: Adds two new fields, named X-coord and Y-coord, to the table
of the first active theme in the TOC and fills the respective fields with
the X,Y coordinates of the selected points (or all points if no selection
is defined) in a point theme. If instead the active theme is a polygon
theme, then the X,Y coordinates of the polygon centroid are calculated. If
the theme is projected, the output coordinates will also be projected.
aiconnct.ave
Name: ConnectToAIServer
Title: Connects to an ARC/INFO Server
Description: Connects to an ARC/INFO server application by opening and
reading the server information from an ARC/INFO connection file. An
ArcView RPCClient is created.
Remote Procedure Calls (RPC) allow client applications to initiate
procedures in a server application across a network. UNIX RPC servers
are uniquely identified by a hostname (the name of the machine the server
application is running on), a server id, and a version number. An RPC
client application uses this information to establish the RPC connection.
ARC/INFO servers may be created using the Arc Macro Language (AML)
function [IACCONNECT], which can be used to create a connection file
containing the hostname, server id, and version number. The file is
opened and read, creating an ArcView RPCClient using the information
contained therein.
aiserver.ave
Name: AIServer
Title: Making and using an ArcView to ARC/INFO RPC connection.
Description: Extablishes an RPC connection with an ARC/INFO server. The
ArcView client submits a task to ARC/INFO to perform the UNION of two
polygon themes and then displays the results as a third theme in the view.
Remote Procedure Calls (RPC) allow client applications to initiate
procedures in a server application across a network. UNIX RPC servers
are uniquely identified by a hostname (the name of the machine the server
application is running on), a server id, and a version number. An RPC
client application uses this information to establish the RPC connection.
In this example the ArcView client will request that the ARC/INFO server
perform a union of two polygon themes. ARC/INFO will inform the client when
the service has been completed, the resulting data source will be added to
the View as a new Theme.
Before running this script, you must establish the ARC/INFO server. Do
this by picking any machine on the network to run Arc, then type at the
Arc prompt this command:
- Arc: &type [IACOPEN]
- Host: rhino Program no: 40000000 Version no: 1
- 0
The hostname, program number, and version number are used by the ArcView
clent to establish a connection. If the second line is not zero, there
has been an error in establishing the ARC/INFO server. To shutdown the
ARC/INFO server type:
- Arc: &type [IACCLOSE]
Important Notes: These AML functions are available at ARC/INFO Rev. 7.0
and newer. This script should be run with a View as the active document and
the View should have two active polygon themes which will be Union'ed.
aligngra.ave
Name: Graphics.Align
Title: Aligns selected graphics in a layout or view
Description: This script can be called from another script to
align the selected graphic objects in a view or layout. The primary
advantage of using this script over the alignment menu provided
with ArcView's interface is that it allows the programmer to control
the alignment, not the end user. The script can be called with
the av.Run request.
Graphic points are handled as a special case. Currently, the origin
of a point is its center, assumming the point has no extent. However
a point does have a height and width, which is compensated for.
avheader.ave
Name: Header.ScriptHeader
Title: Defines the content of the script header
Description: Begin every sample script with the script header
given below. The script header contains the following elements:
*Name is the script name this script should have when it is
loaded into ArcView. The name should have an identifying
prefix. (e.g. DocGUI.AddToolMenu, Project.DeleteEmbeddedScript,
View.FindNearestFeatureTool) If this script runs only on an
Apply event, include the suffix "Tool". If this script is an
Update script, include the suffix "Update".
*Title identifies the purpose of the script and appears in the
contents page. The script title maybe up to 50 characters
long and may contain spaces to separate words. The title
should accurately identify the utility of the script. The
title must begin with a verb in third person tense and describe
what the script does. For example,
+ Adds a ToolMenu to the current ToolBar.
+ Deletes the embedded script from the project.
+ Finds the nearest feature in the active theme to a user specified point.
You must specify the title.
*Topics names the categories under which this script will be listed
in the contents page. You may specify more than one topic if
necessary, but in most cases, the script should fall under one
category. The topics that were used to compile the samples that came with
ArcView 3.0 are:
- TOPIC Relates to these areas in ArcView
- Project = Project objects and Project files
- Script = Scripts and SEds
- View = View document
- Image = Image Themes
- GeoData = Data conversion and manipulation
- Analysis = Spatial and statistical analysis
- Legend = Creating or changing legends
- Chart = Chart document
- Layout = Layout document
- Table = Table document
- Graphic = Graphics and symbols
- GUI = DocGUIs and Virtual Documents
- Geocod = Geocoding
- DBT = DataBase Themes
- Network = Network Analyst Extension
- Spatial = Spatial Analyst Extension
- Misc = Other
*Description provides a complete discussion of what this script does
and how it works. Describe any special algorithms or techniques employed
by this script. You must provide some description of the script. The
description can be any length.
*Requires details the conditions necessary for this script to run.
+ State the kind of document that must be active for this script
to run, for example, the active document must be a view.
+ State the kind of event this script should be associated with if
there are special conditions, for example, this script must be
associated with an Apply event.
+ Identify required extensions, for example, you must load the
spatial analyst before compiling this script.
+ Identify any required data or files or system conditions, and so forth.
+ Name update scripts or other scripts that should be used with this
script.
If the script requires no special preconditions, you can leave this
section blank. This section can be any length.
*Self describes the Self object required by this script. Scripts
called by other scripts use the Self object to pass values. Scripts
associated with events use the Self object to identify the object that
initiated that event (e.g. an update script on a control, an open script
on a document). If the script does not use the Self object, then leave
this section empty. This section can be any length.
*Returns identifies the value returned by the script. Scripts that are
called by other scripts may return a value to the calling script.
Describe any return value in this section identifying its class and
meaning. If the script does not return a value to a calling script,
then leave this section empty. This section can be any length.
There are some general formatting limitations if you intend to use the
Microsoft word template in the samples/other directory called scriptlib.dot.
All headings must have their first letter capitalized, be followed by
a colon, and then two spaces. The latter even if there is no text for the
heading. The dash/hyphen character is reserved, so do not use it in the
text. The dash/hyphen character is used to indicate that line wrapping is
to be turned off, this is useful if you have a script of list within your
description, requires, self, or returns sections.
bivarleg.ave
Name: View.BivariateLegend
Title: Creates a bivariate legend for a theme
Description: Creates a bivariate legend for the topmost active theme
in your view. Specifically, it creates a new legend based on the you
selecting two data attributes, the classification type for each attribute
and the number of classes for the new legend. You will then be prompted to
choose a color ramp for the first attribute and then a size range for the
second symbol. The size range is the diameter of a point symbol, the
width of a line symbol, and the width of the hatchures in the fill symbol.
buffer.ave
Name: View.Buffer
Title: Places buffer around selected features
Description: Places graphic buffer around selected features.
bvreg.ave
Name: View.BivariateRegression
Title: Performs Bivariate Regression and Makes Scatter Chart
Description: This script, when executed from a button or menu item on
the view GUI, will perform a bivariate regression analysis on the selected
data of the active theme or all data in the active theme if no selection
exists. The result of this script is the coefficient of determination, or
R squared. Additionally the user may elect to make a scatterplot of the
data. Also of note in this script is that if there is a null value in the data
set, that data record will not be analyzed, however, values of 0 or other
dummy values will be included unless you screen for them.
calcapl.ave
Name: View.CalculateFeatureGeometry
Title: Calculates feature geometry values
Description: Calculates area and perimeter for polygon themes and length
for line themes. If the View has been projected the calculations are in
projected meters. Otherwise the calculations are in 'native' map units.
Modify the script to provide calculation in the current report units of
the View. The script processes the list of active themes to calculate
area and perimeter, or length, depending on the theme type.
The script will add the fields: Area and Perimeter to polygon themes, Length
to line themes if they do not exist. If the fields exist their values will
be recalculated. Rerun the script if you change the projection of the view.
calcdist.ave
Name: View.CalculateDistance
Title: Calculates distances from points in one theme to points in another
Description: This script will prompt you for two point themes in the
active view. The first is the point theme containing the selected points
that you wish to calculate the distance FROM. The second is the point theme
containing points that you wish to calculate the distance TO.
You will also be prompted for an identifying field in the
FROM theme. The value of this field will be used to name to
distance field in the TO theme.
A distance field will be added to the TO theme for each point
selected in the FROM theme. This distance field will be populated
with the distance between the selected From point and the To point.
If the view is projected, the distance will be returned in distance units.
costfld.ave
Name: CreateTravelCostField
Title: Creates a travel cost field for decimal degree data
Description: If your network data is in decimal degrees
(coordinates of latitude and longitude) and your application
involves finding routes over long distances, such as across
Europe or the United States, using the default cost choice
of may result in a non-optimal route. When the
Network Analyst finds a route using , it does
not take into account the curvature of the earth’s surface.
You can avoid this problem by using a cost field containing
the accurate length in meters of each line. Use this script
to add and populate a field called Meters in your line
theme’s feature table. To run the script, you need only an
open view with a line theme. After you’ve run the script,
be sure to select the Meters cost field before solving a
routing problem.
creatmnu.ave
Name: View.CreateMenuForThemes
Title: Creates a menu item with active themes as choices
Description: An example script which uses the list of currently active
themes to create a new menu on the menu bar which contains choices for
all the currently active themes.
In this example a new menu is added immediately before the Help menu, and
contains the choices collected using theView.GetActiveThemes. Several
Properties for each control are specified.
custleg.ave
Name: Legend.CustomizeRamps
Title: Customize Color Ramps and Schemes
Description: This script alters some files that are stored in your
arcview/etc directory! To avoid accidently wrecking your setup,
copy all files with a .odb to a safe place.
Specifically, this script alters the files that contain the color
ramps and color schemes that are used by the legend editor. You
can change the names of the color ramps, change parts of the color
ramps, add color ramps, or delete color ramps.
cvtplply.ave
Name: View.ConvertPolylineToPolygon
Title: Converts polylines in the active theme to polygons
Description: Converts selected polylines to polygons to create a new
shapefile. If no features are currently selected all polylines will
be processed.
If the polylines are not closed, i.e. the first and last points are
not identical, the user may choose to automatically close all
polylines. This option will move the last point to the first point.
Multi part shapes are not currently supported.
cvtplypl.ave
Name: View.ConvertPolygonToPolyLine
Title: Converts polygons in active theme to polylines
Description: Converts selected polygons to polylines to create a new
shapefile. If no features are currently selected all polygons will
be processed.
Multi part shapes are not currently supported.
demfill.ave
Name: Spatial.DEMFill
Title: Creates a grid theme by filling all sinks in another grid theme.
Description: Takes a grid theme and fills all sinks, areas of
internal drainage, contained within it. The aGrid.FlowDirection,
aGrid.Sink, aGrid.Watershed, aGrid.ZonalFill, and aGrid.Con
requests is used to fill the sinks. The process of filling
sinks can create sinks, so a looping process is used until all
sinks are filled. One cell sinks are not filled. Sinks of
any depth are filled.
dictsel.ave
Name: Script.ReturnValueFromDict
Title: Returns value from selected key in a dictionary
Description: Builds a list containing the keys from a dictionary, prompts
the user to select one of the keys from the list, and returns the
corresponding object from the dictionary. Nil is returned if the user
clicks Cancel or if an error is encountered. The prompt string, title and
sort are optional.
Usage: anObj = av.Run("DictionarySelect", {aDict, aPrompt, aTitle, true})
edtimglg.ave
Name: View.EditSBImageLegend
Title: Edits the legend for single band image theme
Description: Alters the legend for a single band image theme. The legend
will be changed so that the background color is transparent, allowing
the overlay of rectified single band images on top of other data without
hiding the background themes.
The script will work on single band images only. See the commented
sections for assigning other colors.
edtscrpt.ave
Name: Script.UseSystemEditorForScripts
Title: Edits Avenue scripts in system editor
Description: Uses a system editor specified by the user to edit the current
Script. The contents of the active SEd are copied to a temporary file and
opened with the specified system editor. After the editor has been closed
the contents of the temporary file are copied back to the SEd and compiled.
The request SetScratch is used to ensure removal of the file.
encprj.ave
Name: Project.EncryptProject
Title: Encrypts and saves current project
Description: Encrypts the current project and saves to specified output
file. Project encryption will encrypt and embed all scripts within the
project. This is an irreversible action which hides customizations from
subsequent project users.
encscrpt.ave
Name: Project.Encrypt&EmbedScript
Title: Encrypts and Embeds a script into current project
Description: Encrypts and embeds the current script. Encrypted scripts
prevent examination of the source code. Once a script is encrypted it
cannot be decrypted. The Script Editor (SEd) for the script is removed
from the current project.
envtrans.ave
Name: EventTransform
Title: Transforms dynamic segmentation events from one route theme to another
Description: Transforms dynseg events from one route theme to another.
Creates a new .dbf file as the output containing new measures for events.
evntxfrm.ave
Name: View.EventTransform
Title:
Description: Transforms dynseg events from one route theme to another. To use
the script, a dynseg event theme (converting from) and a dynseg theme
(converting to) should be selected in the table of contents for a view.
Then run the script (or press the button with the script attached).
expclean.ave
Name: View.CleanShape
Title: Cleans and exports shapes of themes.
Description: Cleans the shapes of the active themes & exports
to a new shapefile.
A symptom that your polygon shapefiles are "dirty" is if they shade the
entire view window ("bleed") when you zoom in. However, dirty shapefiles
will also produce odd effects with overlay requests, area calculations,
spatial joins, etc.
This script is similar to the script used by Convert to Shapefile;
however, this script will runs slower because it takes time to
clean each shape.
exptlay.ave
Name: Layout.Export
Title: Exports a layout file suitable for printing
Description: This script shows how you can create a printable file
from a layout. In this form, this script mimics the request,
aLayout.Export, which displays a dialog window allowing the ArcView
user to select a filename and output format. Although this script
also contains a similar user interface, you can easily change the
code to hard code filenames and output formats to suit your needs.
exptview.ave
Name: View.Export
Title: Exports a View to file suitable for printing
Description: This script shows how you can create a printable file
from a View. In this form, this script mimics the request,
aView.ExportDisplay, which displays a dialog window allowing the ArcView
user to select a filename and output format. Although this script
also contains a similar user interface, you can easily change the
code to hard code filenames and output formats to suit your needs.
findnear.ave
Name: View.FindNearestFeatureTool
Title: Finds feature nearest to a point
Description: Finds the nearest feature in the active theme to the point
entered interactively by the user. Reports the distance and selects the
feature. Processes the currently selected features in the active theme
within the minimum search tolerance. If no features are selected, all
features within the search tolerance will be considered.
fldprops.ave
Name: Table.FieldProperties
Title: Displays field properties
Description: This example script uses some of the requests for a Field to
get information about the currently selected field, and displays the
collected information using MsgBox.Report.
fndstrng.ave
Name: Script.FindString
Title: Finds specified string a script
Description: Searches for the specified string and, when found, places
the insert position (the window cursor position) at the string.
genfeat.ave
Name: Theme.GeneralizeFeatures
Title: Removes unneeded vertices from selected features
Description: Simplifies the shapes in a shapefile that is created from
the selected features for each active polyline or polygon theme. This
script is used to generalize, or weed out, vertices that do not add
to the desired level of detail in the definition of the shape geometry. A
tolerance is specified to check whether or not vertices should be
retained.
This script is a simple implementation of the Douglas - Peucker
algorithm used in ARC/INFO and PC ARC/INFO. It should be used as
a button in a View GUI.
A few thoughts to consider:
1. The script first creates a new shapefile for selected features of
an active theme. The new shapefile is added to the view. The original
theme is not changed.
2. This script will reduce the quality of the data. Any metadata for
the themes should state that the data has been modified.
3. Results are very dependent on the polygon geometry. Shapes
created from adjacent polygons may no longer be coincident. They
may overlap, or leave a sliver. Proceed with caution.
4. Results are very dependent on the polyline geometry. While the
shape endpoints are maintained, interior points may be eliminated.
Other shapes in a network that may begin or end at an interior vertex
may now be dangling. A complex shape may cross itself after being
generalized. Proceed with caution.
5. The only check on the resulting geometry is to be sure a polygon
has not collapsed completely by removing too many vertices. If so,
the shape will revert to the original.
6. This script does not recalculate areas, perimeters, or lengths.
They may have changed as the shapes are simplified. The
"CalculateAreaPerimeterLength" sample script can be used to update
the values.
geocode.ave
Name: Geocode.Table
Title: Geocodes addresses in a Table to a matchable Theme
Description: Geocodes addresses found in a table to a matchable theme.
It is assumed that the addresses and theme use US style addresses. The
script can be modified to support other address styles. Geocoding results
are reported and the new theme is added to the current View and drawn.
geolocte.ave
Name: Geocode.dialogbox
Title: Create your own dialog box for locating an address
Description: This script allows you to create your
own dialog box for locating an address. In addition to customizing
the Locate dialog interface, this script addresses an issue of
setting an offset distancefor the geocoded event.
At the current design, the Locate dialog box always applies the
MatchSource default offset. It is 0 (zero) for both US Streets with
Zone and US Streets Address Styles. An avenue request is not available
public for changing the MatchSource default offset. In order to specify an
offset when locating an address, you need to use some avenue requests for
matching instead of the LocateDialog. Below is a sample script which
allows you to create a dialog box for getting an event address and
locate it with an offset distance of 30. Please modify it as needed.
You can still use the system's View.LocateUpdate as an update script if
you want to create a new button.
getuniq.ave
Name: Table.GetUniqueValues
Title: Gets unique values for specified field
Description: Returns a list of unique field values for the selected rows
in the specified table. Functionally similar to the ARC/INFO AML function
[GETUNIQUE].
The script will process the selected rows in the VTab, if any, or will
process all records in the VTab if there are no selected rows.
The user provides the VTab or FTab and a Field. The script returns a
unique list of values for the specified Field sorted in ascending order.
The unique values are returned as a list of strings. If an error occurs
Nil is returned.
Example use; allow the user to select from a unique list of State names
from the active Table:
- theTable = av.GetActiveDoc
- theField = theTable.GetVTab.FindField("State_Name")
- theList = av.Run("GetUnique", {theTable.GetVTab, theField})
- c = MsgBox.ChoiceAsString(theList, "Choose a State:", "Choice")
gps2shp.ave
Name: GPS2Shape
Title: Converts ASCII GPS output to shapefile
Description: Reads coordinate information from the specified file, prompts
the user for the output shapefile type (line, point, polygon), and creates
the shapefile. In the case of polygons the first point is used to close
the polygon.
Many GPS devices include software which can produce output in various ASCII
formats. This script assumes that the file will containing comma delimited
coordinates in the format:
- station_id, x_coordinate, y_coordinate
- station_id, x_coordinate, y_coordinate
- ....
The script assumes that each record in the input file is a data record,
i.e. there is no header. Coordinates are read until the end of file is
reached or until the string "END" is found. Modify the code to support
different file formats. This script does not support any specific GPS
output format in particular. It is an example script that can be modified
for the exact ASCII output format required.
grafclip.ave
Name: Graphic.ClipFromGraphic
Title: Extract and clip features by graphics
Description: Using the selected graphics this script will
extract all features of the active theme and clip their boundary
to the graphic. All theme attributes are extracted as well.
gratlay.ave
Name: Layout.Graticule
Title: Creates Graticules, Tics, and Labels for a ViewFrame
Description: This script offers several options for placing graticules
and tics on a ViewFrame. You may specify the interval between each
graticule line or between each tic mark.
gratview.ave
Name: View.Graticule
Title: Creates Graticules, Tics, and Labels for a View
Description: This script offers several options for placing graticules
and tics on a View. You may specify the interval between each
graticule line or between each tic mark.
grplegbt.ave
Name: Layout.SimplifyLegendByTheme
Title: Simplifies a legendframe and groups by theme
Description: This script breaks a Legend Frame into Graphic Groups
organized by the original themes. The name of the theme is
assigned to each graphic group, for further manipulation, if desired.
If the theme has been classified, the graphic group for each theme
is also subgrouped and each subgroup named by classification label.
This script is used in preparation for deleting a legend entry that is
obvious, such as a theme showing the 48 states. A selected set
of theme groups can be respaced using the Align menu choice, or a single
theme group can be ungrouped to the individual classification subgroups
for rearranging to suit the spacing constraints on the layout document.
This script depends on the graphic elements being added to the legend
in the order consistently used in ArcView 2.1. This may change in
future releases.
This script should be used with a button on the Layout GUI,
or it could be called from a script that automates a layout creation.
gtable.ave
Name: Layout.GraphicTable
Title: Places a Graphic of the table you specify into a layout
Description: Use the tool with this script attached as the
apply event to drag a rectangle in a layout. You will be prompted
to choose which table you want to make the representation of
and which fields to show. The script will populatate rows with
cell values of those fields until the bottom of the rectangle
you specified is reached. If you choose more fields than would
fit within the width of the rectangle, those will be included.
This script gets around several annoying limitations in ArcView's
TableFrame graphic:
1) With this script you can make a table that is wider than 80
text columns. (Great for landscape docs).
2) You change the font of this table.
3) Since this table is graphicgroup, you can ungroup it and
change the symbols for individual parts.
4) This table will always print correctly - on some printers
printing directly from the table doc & from table frames,
there were gross formating errors
5) You can resize this table and the text just gets resized,
rather than including more data like the tableframe does.
This script cannot produce the representation of the table if
it is sorted - you will get the unsorted version. Additionally,
since this representation is just a dumb graphic, it does not
automatically update itself in any way, shape, or form.
Additionally, you can use the symbol window to change the button
color by using the foreground, change the table background by using
the background color, or change the text and outline color as well.
If you want to highlight a particular column, ungroup the graphic
table and then you can select the column by clicking on its border,
then change its background color or text color by using background
or text from the color palette.
hidelgnd.ave
Name: View.HideLegendForInvisibleThemes
Title: Hides the legend for all non visible themes
Description: This script automatically hides/shows theme legends
depending on whether or not the theme is visible. When a theme is drawn
the theme legend will become visible, when a theme is toggled off the
legend will be hidden.
This script should be installed by using it as the update script for the
View by using aView.SetUpdateScript(aScriptName), or use as the update
script for any control in the view's docGUI.
hiselgra.ave
Name: View.HighlightSelectedGraphics
Title: Highlights selected graphics on a View document
Description: Highlights the selected graphic on a View document with the
project's current selection color. Can be installed as the apply event
for a Tool in the View docGUI. Useful when the View has a large list of
graphic objects, and the selection handles are not sufficient for indicating
the current selection.
When the graphic is selected, the color will be changed to the current
project selection color. The color of unselected graphics will be changed
to the unselected color specified in the script below. Note that the color
of selected graphic polygons will not change, since by default ArcView
uses a transparent symbol.
histogrm.ave
Name: Table.Histogram
Title: Displays a histogram for selected field in table
Description: Generates a histogram for the selected field in a Table.
A new Chart document is created to display the histogram. A temporary
file is created to store interval counts and other information used to
create the histogram.
Should be associated with the Click property of a button on the Table
DocGUI. An update script should be associated with the control to ensure
that this script can only be executed when a numeric field is selected.
idlinked.ave
Name: View.IdentifyLinked
Title: Replaces Identify Tool with smarter version for links
Description: When this is used in conjunction with (after) the
View.One2Many script this tool will effectively replace the identify tool.
The result of using this tool instead of the identify tool will be that
when you identify a feature whose FTab has links to it will be to see the
values in the linked tables
imgcat.ave
Name: View.CreateImageCatalog
Title: Creates image catalog from image themes in view
Description: Takes all the images in a selected view and creates a dBASE
table on disk which can be used as an Image Catalog. If the view contains
feature themes, they are skipped over. If the view is not the active
document, you are presented with a list of all the views in the project.
The dBASE file is added to the project for review. The new image catalog
is added to the same view as the images.
imscript.ave
Name: Script.MakeScriptFromFile
Title: Imports text from file into new SEd document(s)
Description: Creates a new SEd from the specified source file(s) and
adds the new SEd to the project. Checks for a Name specified in the header
and if found sets the SEd name to the header name, otherwise uses the
basename of the source file. Uses the ArcView standard header.
To optimize performance for scripts which don't use the standard header,
only the first lines in the file are searched to find the name. The
number of lines to search is specified as the lineSearchLimit.
intrsect.ave
Name: View.IntersectThemes
Title: Performs an intersection of two themes
Description: This computes the intersection shapefile from 2 themes:
an intersection theme (poly or line) and a overlay theme (poly). The
output file has all the attributes of both themes for each intersection.
Modeled after the ARC/INFO Intersection command.
labwthin.ave
Name: View.LabelOnlyFeaturesBiggerThanLabels
Title: Labels only features whose labels are smaller than their own extents.
Description: If the GraphicText is wider than the width of the feature
it is labeling, then the label will not be placed. This is a slight derivation
of the auto-labeling script that was shipped with ArcView 2.0
lnkimgvw.ave
Name: View.HotLinkImage
Title: Hotlinks an image to display in a View
Description: A hotlink script that can be used in place of Link.ImageFile
to display an image as a theme in a View document rather than in an
ImageWin. Some images will display faster and have better display quality
when displayed as themes in Views.
The View TOC is automatically hidden and locked when the View displaying
the hotlinked image is opened. When the image View is closed, it will be
automatically removed from the project.
A new docGUI, comprised of only the controls that are appropriate for
viewing the image (such as pan, zoom, etc.) may be created and assigned to
the image View by uncommenting the lines of code as indicated in the body
of the script. Create a new docGUI by cloning an existing docGUI and
modifying with the Customize Dialog Box. See docGUI in the Avenue Help
for further information, or use the sample script called GUIManager.
makergb.ave
Name: Graphics.MakeRGBColors
Title: Create Colors from a RGB list
Description: This script loads a RGB color list and creates colors
in the color palette from these values. The RGB should be in the format:
RED , GREEN , BLUE, e.g. 255,255,255.
matchcoo.ave
Name: Geocode.MatchCoordinate
Title: Matches an address record to a coordinate
Description: This tool begins execution by providing a list of unmatched
addresses in the active geocoded theme. Select one of the addresses in
the list then specify a location with the cursor. This will create a
point on the specified location and link it to the appropriate record in
the feature table. This changes the AV_STATUS value for the record from
U to C.
matchcoo.ave
Name: MatchAddressToCoordinate - CLICK script
matchcoo.ave
Name: MatchAddressToCoordinate - UPDATE script
mcolleg.ave
Name: Layout.MultiColumnLegendTool
Title: Creates legends with one or more columns
Description: Creates a graphic legend for a view in a layout document. The
view does not have to be in the layout. You can choose which themes are to be
included, whether to make one column per theme or a specific number of columns,
and what the title of the legend should be.
For single symbol legends, the script handles things a bit differently
than in the TOC. If there is a label for the symbol, that will be used
to label the symbol, but if not then the theme name is used. In any
event there is not a title for the Theme in the legend, because it
looked awkward in most cases.
There are additional options for the shape that is used for polygon and
line legends. Just switch the comments for the existing options or add
your own. Currently, Polygons may be displyed as either rectangles or
wide ovals and Polylines can be displayed as either a squiggle or a
straight line.
This legend cannot be updated, but you can just delete it and make it
anew. This script just creates a bunch of graphicshapes and groupes
them.
To change the color of the background polygon, select the group and then
from the symbol window set the color palette for background color, and
set the color to whatever you want. If the color palette is set for
anything other than background, you run the risk of changing the colors
of your legend, which would defeat the purpose of having a legend.
Lastly, this script does not not handle themes which have legends of
type chart.
TitleWidth = theThemeTitle.GetBounds.GetWidth
mif2shp.ave
Name: MIF2SHP Converter
Title: Converts MapInfo Interchange Format (*.MIF) to ArcView shapefile format.
Description: Imports a .MIF and its corresponding .MID (if exists) and creates a
native ArcView shapefile.
The script is split up into two parts. The first part reads through
the .MIF file. It senses these components:
- Delimiter = delimiter for MID attributes
- Columns = the column definitions
- Point = a point feature
- Region = a region feature
- PLine = a polyline feature
- Line = a line feature
The results go into an FTab which gets created when the first geometric
feature is encountered. Until then, the field definitions which are
encountered are kept in a list.
As geometric features are encountered, records are added to the FTab.
After the file is read, the attribute values are read from the .MID file.
See notes included below.
mkpensym.ave
Name: Graphics.MakePens
Title: Makes pen symbols
Description: This script creates two new views, named Pens and Composite
Pen, into which different line symbols are drawn. Using the appropriate
requests, the line symbols are modified.
mrgthmcl.ave
Name: View.MergeThemesClick
Title: Merges Active Themes Click
Description: Merges the active themes into a single theme. A new
shapefile is created which combines the shapes and attributes of the
active themes. The themes to be merged should have the same set of
attributes (fields). Only the fields from the first active theme are
preserved in the output theme.
Associate this script with a new control. Use the corresponding
update script to enable the control and ensure that preconditions are
met for proper script execution.
mrgthmup.ave
Name: View.MergeThemesUpdate
Title: Merges Active Themes Update
Description: Used to enable/disable a control for the execution
of MergeThemesClick (mrgthmcl.ave). Will ensure that there are at
least two active themes and that the feature types are the same.
multmtch.ave
Name: Geocode.MultiMatch
Title: Geocode to several matchable themes simultaneously
Description: This script implements "drop-back geocoding".
For example, if you want to first attempt to match to a street address,
then, if the first match fails, match to the county field instead. If
the match is made to a polygon, the centroid point will be the geocoded
point. The event data to be matched will be geocoded to themes in the
order they appear (selected) in the view.
mvgra2pt.ave
Name: Graphics.RepositionGraphic
Title: Moves and centers a graphic
Description: Moves and centers the graphic to the specified coordinate.
The graphic is centered on the input coordinate. Expects a string to
be passed from the calling program containing the x coordinate,
y coordinate, and name of the graphic object. The graphic object must be
uniquely identifiable by its name. Use the SetName request to set the
name of the graphic to any string.
Can be used to update the locations of uniquely named graphic objects
from external programs via DDE or RPC.
ndvipal.ave
Name: ImageLegend.SetNDVIColor
Title: Sets the color map of an ImageTheme to a NDVI file
Description: Using the contents of an NDVI color file, this
script resets the colormap for an image theme.
nearest.ave
Name: View.SpatialNearestNeighbor
Title: Perform Spatial Nearest Neighbor Analysis
Description: Create a new tool in a ViewDocGUI with this script as
the Apply script. To use this you must have an active theme. Just
drag a rectangle around the features you wish to conduct a spatial
nearest neighbor analysis of. The wait cursor will appear and then
a messagebox will tell you the R value and how many features were
accounted for in the analyis. R values relate how clustered or
dispersed points (or centroids of polygons and polylines) are within
the rectangle you specified. An R value of 0 (zero), indicates
an intensely clustered pattern, while an R value of 1 indicates
a random distribution, and an R value of 2 (or higher) indicates
strongly dispersed or organized pattern.
neatline.ave
Name: Layout.Neatline
Title: Adds a neatline inside the layout page margins or a bounding line
around a selected graphic
Description: This script adds neatline and bounding line graphics to the
layout. A neatline is a simple outline just inside the layout page
margins. A bounding line is a rectangle around the bounds of the
selected graphic.
This script gives the option of adding a neatline or bounding line
graphic. You can specify how far inside the margins the neatline graphic
will be placed as well as how far outside the selected graphic the
bounding line graphic will be placed.
Both graphics are polylines; line widths and styles can be changed using
the pen palette, and color changes with the color palette.
The script can be added as a menu choice, button or popup item. It is a
click event.
npcl.ave
Name: Layout.NestedPieChartLegend
Title: Creates nested legend for piecharts with size field
Description: If you have a pie chart legend in a view, make it the
active theme and then make a layout and then a viewframe with that view.
Use this script as a tool. When you click in the layout display, the
location will become the lower left origin for a graphic group that will
contain a legend for your piechart legend.
npclup.ave
Name: Layout.NestedPieChartLegendUpdate
Title: Update script for Layout.NestedPieChartLegend
Description: This is the update script for Layout.NestedPieChartLegend
one2many.ave
Name: View.SetOneToMany
Title: Sets up OneToMany relationships for tables linked to themes
Description: It sets up a OneToMany from the feature attribute
table of the first active FTheme in the view, to a user selected
'many' table. This method has to be used in preference to the standard
"user interface" method, as it sets up variables for the ID function.
To set up a OneToMany link from a theme's attribute table to a 'many' table
(both assumed to be in the project already), first activate the theme in the
view. Then select the button to create the one-to-many relationship (i.e.
the button which runs View.SetOneToMany). This will ask the user
to select:
-(1) The link-field (key) in the theme's attribute table
-(2) The 'many' table
-(3) The link-field (key) in the 'many' table
-(4) Whether the records are to remain selected after the ID
The user will see the normal ID window for the 'one' record, and if there
are any 'many' records related to that 'one', then they will be also added
to the ID window.
If the user has nominated in the setup that the records are to remain selected,
then they will be in the 'one' and the 'many' tables.
At this point the user may use the View.IdentifyLinked tool to identify features.
The IdentifyLinked tool will show the record from the 'one' table and then show
any additional records from the 'many' table. If the user has nominated in the
set-up that the records are to remain selected, then they will be in the 'one'
and the 'many' tables.
Title: Sort order of TOC by type of theme
Description: The order of themes in a view's table of contents is
rearranged so that image themes are drawn first, followed by regions,
polygons, routes, lines, text, and point themes.
Theme types, and the order they are sorted in, are found in the list
called theTypes. Change this list to suit specific ordering needs.
pcarced.ave
Name: View.pcARCEDITTheme
Title: Opens Active Theme in pcARCEDIT
Description: Uses the currently active theme and launches pcARCEDIT
through the WEDIT shell macro. The editcoverage, drawenvironment, and
editfeature are supplied by the active theme.
Once editing is completed the user must rebuild topology. After quitting
ARCEDIT the user is returned to ArcView.
randsel.ave
Name: View.RandomSelection
Title: Selects a percentage of a theme's features randomly
Description: This script will create a random selection of features
based on a percentage of the total number of features (for example: a
random sample of 5% of the counties in the USA coverage).
rasveclg.ave
Name: View.LegendRasterToVector
Title: Changes legend from RasterFill to VectorFill
Description: Legends can use symbols of several types. The default
type is a legend that uses solid fill symbols (class RasterFill). This
script provides an example which demonstrates creating hatched symbols
(class VectorFill) and setting symbol properties such as color and angle.
Existing symbols in the legend are returned as a list using
aLegend.GetSymbols. The list of symbols is a reference (not a copy) of
of symbols in the legend. Because it is a reference, new symbols can
replace existing symbols in the list using the List request Set.
Note that after the legend is modified InvalidateLegend is used to update
the TOC of the View. aTheme.Invalidate is used to redraw the theme using
the new legend.
replstr.ave
Name: File.FindRepString
Title: Finds and replaces string in a file
Description: Searches for the specified string in the file and replaces
it with another string. Can be used to change UNIX, DOS or Macintosh
pathname specifications found in project (*.apr) files for use on other
platforms. May also be use to replace paths with system environment
variables (e.g. $DATA_HOME).
repscrpt.ave
Name: Project.ReplaceSystemScript
Title: Replaces a script with script in active SEd
Description: Replaces the specified script chosen using the Script Manager
with the script associated with the active SEd. Can be used to override
scripts such as Project.Button1 (the script which executes when you click
the first button in the Project Window).
The existing script is not 'overwritten'; a new script with the same name
as the old script will be found first, and therefore will be executed in
place of the original. The new script has the same name as the old, but
is in upper case, therefore making it easy to identify for removal to
restore the default functionality. Remove a script from the Script
Manager using the sample script RemoveScript.
retrndoc.ave
Name: Project.ReturnDoc
Title: Returns a document of a specific class
Description: This script is a workaround for the problem of using either
the GetActiveDoc or FindDoc request in that there is no way of specifying
a particular class of document. If you use the FindDoc request, and two
documents contain that name, there is no way to guarantee that you will get
the one you want.
revgeoc.ave
Name: View.ReverseGeocode
Title: Finds the address for the specified point location.
Description: Converts an x,y location to the nearest address. The location
can be taken from a mouse click, or from an external source
such as a GPS device.
The nearest feature in the address theme will be used to derive the
address. A large search tolerance may increase the number of candidate
features but will increase processing time to find the nearest feature.
A sample script is included commented at the end of this script which
can be used to gather the information required and call this script.
rgb2avp.ave
Name: MakeRGBColorPalette
Title: Makes new color palette based on RGB values in file
Description: This script reads RGB values from a text file and then
writes them into a new palettes file (.avp). The RGB file must be a
comma delimited text file where each line contains three values, e.g.,
255,255,255. Make certain there are no blank lines at the end of the
RGB file.
rgbdict.ave
Name: Graphics.RGBDictionary
Title: Makes an RGB NameDictionary
Description: Creates and returns a dictionary of RGB values for the
X Window System color name database. The ASCII color name is the
dictionary key, the value for each key is a list of numbers; the RGB
values for the named color.
The Color class in ArcView supports the specification of colors using
RGB values. This dictionary can be used to retrieve the RGB values
for a specified color by creating a script as follows:
- rgbDictionary = av.Run("RGBColorNameDictionary", nil)
- plumRGBList = rgbDictionary.Get("plum")
or this script can be modified to return the RGB values directly.
rndscale.ave
Name: Layout.RoundScaleBarInterval
Title: Rounds the interval of selected scale bars.
Description: Rounds the scale bar interval to the nearest interval
as specified in an interval range. The interval range is essentially
a list of numbers the interval can be set to. The range can be modified
as necessary.
The interval range is controlled through a variable called "int_range".
Through this variable, you define the range of possible intervals
the current interval can be rounded to. In this sample script,
int_range = {{3,1},{2,2},{1,4}}. This sets the interval range as
1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4, 5...9. For each list, {a,b},
"a" is the leftmost non-zero digit of the interval, and "b" is the number
of fractions to break the interval into.
The script finds the leftmost non-zero digit of the interval and
places a decimal point after it. Then it rounds the interval to the
nearest value as specified in the interval range. For example, given
an interval of 1589, this number is converted to 1.589. 1.589 is greater
than 1 (of {1,b}) but less than 2 (of {2,b}). This means the 4th fraction
({a,4}) of 1, or 0.25 sets the interval range to 1, 1.25, 1.5, 1.75.
1.589 will be rounded to 1.5, or specifically, 1589 will be rounded to 1500.
Here are some other int_range values to help you understand the relationship.
- int_range = {{3,1},{1,4}} yields 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5,
2.75, 3, 4, 5...9
- int_range = {{3,2},{1,4}} yields 1, 1.25, 1.5, 1,75, 2, 2.25, 2.5,
2.75, 3, 3.5, 4, 4.5...8.5, 9
- int_range {{1,2}} yields 1, 1.5, 2, 2.5, 3, 3.5, 4...8, 8.5, 9
savscrpt.ave
Name: Project.SaveAllScripts
Title: Saves all scripts to current working directory
Description: Writes all scripts in the current project to the working
directory. The default filename will be the name of the SEd in the
project. Blanks in the name are substituted. The user may optionally
choose to enforce unique 8.3 compliant filenames. Otherwise, a warning
is displayed if the file already exists.
sdecheck.ave
Name: View.SDESetupCheck
Title: SDE Configuration Check
Description: This checks to see if the correct lines exist in both the
HOSTS and SERVICES files for Database themes to work. It does not
connect to the SDE server.
sedfndrp.ave
Name: Script.FindReplace
Title: Finds & replaces aString in a SEd document.
Description: Prompts the user for a string to search for and its
replacement string. The search will begin at the current cursor insert
point. If the script is executed from a control the object tag of the
control is used to store the previous find/replace parameters.
selbycir.ave
Name: View.SelectByCircle
Title: Selects features in active theme using a circle
Description: Allows the user to specify the size circle to select features
in the current active theme and creates an on screen report of information
from the selected field.
Provides an example of creating shapes and drawing them temporarily on
the view Display using display clipping. The shape is symbolized using
a programmer specified symbol. The shape will appear on the Display until
the Display is refreshed. A report is generated and displayed using
MsgBox.Report.
shp2gen.ave
Name: View.ShapeToGenerate
Title: Exports active theme to ARC/INFO export format
Description: Exports the active themes to ARC/INFO Export (Generate)
format files. Each active theme will require the user to specify an
output file name. The format of the export file with be either POINT,
LINE, or POLYGON depending upon the type of Shape Field found in the
Theme FTab (the Enum Type FieldEnum).
The user will be prompted for the field from which to create IDs in
the generate file. If is selected the ID for the feature will
be set to the current FTab record number.
In the case of overlapping polygons, the data should be further
converted into an ARC/INFO region coverage with the REGIONCLASS
command. ArcView polygon shapes may need to be modeled in ARC/INFO as
regions to handle the case of polygons with multiple parts.
Following conversion of the generate file to an ARC/INFO coverage
the Theme's FTab can be exported to an INFO file that can be joined to
the coverage Feature Attribute Table (FAT) to restore all attributes as
found in the original Theme. Consult ARC/INFO command documentation for
JOINITEM and related commands.
When creating polygon format Generate files the AUTO keyword is used
along with the feature ID to indicate that labels will be automatically
created when coverages are imported using ARC/INFO Generate. Consult
the ARC/INFO Generate documentation for additional options and discussion.
spider.ave
Name: View.SpiderDiagram
Title: Create spider diagrams
Description: Creates spider diagrams based on liner distances between
the points contained in two point themes. The Output is a new (spider)
theme with distances stored in the FTAB.
spidx.ave
Name: Data.CreateSpatialIndex
Title: Spatial Index Creator
Description: This script processes a specified directory tree creating
spatial index files for every coverage and shapefile found in the tree.
stanshpe.ave
Name: View.CreateStandardizedAddress
Title: Creates a standardized address Table from unparsed addresses.
Description: Creates a standardized address table from unparsed addresses.
A new table is created with separate fields for each element of the address
and the table is joined to the original table for geocoding.
Expects that the original table has house number ranges in four separate
fields but the rest of the address information, such as prefix direction,
prefix type, street name, street type, and suffix direction, is in a single
field. The script parses this information against a MatchKey and creates
a new table with these items in separate fields. The new table is joined
to the original table for geocoding.
subpath.ave
Name: Project.SubstitutePath
Title: Changes pathnames in project files
Description: By running this script you can change the paths to data
locations within an ArcView project file. The reason you would do this
is to be able to move your data and/or your project to other disks or
directories and avoid having to go through the project repair process.
The premise behind this script is the use of an environment variable
which is dynamic in the sense that it will always point to the location
of the root of your data directory.
Interaction with the user goes like this:
- 1. Ask for the environment variable in question and confirm its value.
- 2. Ask what directory we are looking for in the projectfile path strings.
- 3. Ask what project file is to be edited.
- 4. Ask for an output file name for the edited project file.
Lines are also provided to hard-code these parameters.
The script will look for path strings, parse the given directory from the
string, and substitute the address preceeding it with the value of the
environment variable.
For example, if the environment variable value is '/pv1/newstuff'
and the directory we are locating is 'work' then a pathname in the
project file such as this:
Path: "/sta3/april/work/bowne/data703/info/soil2polycl.patpoly"
will become this
Path: "/pv1/newstuff/work/bowne/data703/info/soil2polycl.patpoly"
symdump.ave
Name: Layout.SymbolDump
Title: Dumps symbols from palette to layout
Description: This script allows you to dump the contents of a symbol
palette into a layout. Specifically graphics of the appropriate sort
are generated and symbolized with a symbol from the palette, there
will be one graphic per symbol. This script handles text symbol a
bit differently, if the text does not fit in one layout, multiple
layouts will be created to accomodate additional symbols
tblinput.ave
Name: Table.CreateNewTable
Title: Creates a new Table using MultiInput dialog box
Description: An example script which demonstrates creating a Table from
user inputs. An empty Table is created and MsgBox.MultiInput is used to
prompt the user for information to add to the Table.
The input form will be presented until the user clicks cancel. After
clicking cancel the new Table document will be added to the project and
opened.
The default ID in the dialog box is incremented for each record, as is
the record number displayed in the dialog box title. Note that while no
validation is possible in the dialog box itself, the numeric value for
the ID field is verified before it is written to the table. If the value
entered was not numeric, a default value is used.
textmask.ave
Name: Labeling.CreateTextMasks
Title: Creates text masks for a theme's labels
Description: Adds a text mask polygon for each piece of GraphicText
associated with a theme. Use the symbol window to customize the
text masks.
thm2gphx.ave
Name: Graphics.ShapetoGraphic
Title: Shape to Graphic Convertor
Description: This script creates a graphic for each selected record of
the active theme. If no selection is made, then graphics will be made
for all features.
thmhisto.ave
Name: Theme.Histogram
Title: Creates a histogram for the active theme
Description: Generates a histogram for the active theme in the current
view. A new Chart document is created to display the histogram. A temporary
file is created to store interval counts and other information used to
create the histogram. The color scheme used to create the chart will be the
same as the legend of the active theme, i.e. there is direct correlation
between the theme classification colors and chart colors.
Should be associated with the Click property of a button on the View
DocGUI. An update script should be associated with the control to ensure
that this script can only be executed when there is at least one active
theme.
thmsumm.ave
Name: View.SummarizeOnTheme
Title: Summarizes selected fields from active theme
Description: Uses the SummaryDialog to allow the specification of fields
and rules for aggregation. The summarization occurs directly from the
view document, using the current active theme.
The result of the summarization is a new .dbf file, which is opened. If
the Merge option is chosen, a new theme is created and can be added to a
view. This script provides similar functionality to existing controls in
the table DocGUI, however this is executed directly from a view.
thrshtoc.ave
Name: View.ThresholdTOC
Title: Tells you if theme isn't in display threshold
Description: If a theme is outside the display threshold, ">>" and "<<"
will appear around the theme's name to indicate that it does
not appear in the view because it is outside the display threshold
set for the theme. If the theme's name is preceded by ">>", this
means the view's scale denominator is larger than the theme's
maximum threshold; if the the theme's name is preceded by "<<",
the view's scale denominator is smaller than the theme's minimum
threshold.
You could add this script to the end of all the View Zoom
controls (ZoomIn tool, button, and menu choice, ZoomOut tool,
button and menu choice, ZoomToFullExtent, etc.)
so that you can always know the status of the display.
tinfo.ave
Name: Table.ReportInfo
Title: Reports on a table's structure
Description: Working off a table document this script reports
on the structure of the table
togctrls.ave
Name: Project.ToggleCtrlVisibility
Title: Toggles the visibility of Controls
Description: Toggles the visibility of all buttons and tools in the
current document's graphical user interface (DocGUI). This script
should be installed as the click property for a menu item.
After the first execution, the menu item label will automatically change
from 'Controls Visible' to 'Controls Invisible' along with the current
visible status of the controls. Though this sample script only toggles
control visibility, any control property can be changed using Avenue.
wdb2shp.ave
Name: View.WorldDataBaseToShape
Title: Converts World Data Base (WDB) line files to ArcView Shapefiles
Description: Converts line features from World Data Base (WDB) file to
ArcView Shapefile
wrxyinfo.ave
Name: View.XYCoordDump
Title: Creates a file with coordinate information from user
Description: Creates a comma delimited textfile containing a unique ID,
x and y coordinates, and user input information. The coordinate
information is taken from the location on the View chosen with the mouse.
The Object Tag of the tool executing this script is used to store the
current point id number. The number is retrieved at the time of execution,
incremented, and written to the file, ensuring a unique ID number.
Additional attributes concerning the location are input by the user, and
all information is written to the specified file.
The features described in the file, by their xy coordinates, may be added
as a theme. First import the textfile as a Table, then use the Table as
an XY event source.
The points appear temporarilly and are not saved as part of the GraphicList
of the display. See the section commented in the body of the script below
to add points as Graphics to the GraphicList.
xls2tbl.ave
Name: Table.MakeFromExcel
Title: Creates a new table document from an Excel spreadsheet
Description: This script allows you to create a table document using the
data contained in a Microsoft Excel Spreadsheet. Start Excel and open
the spreadsheet that you want to use in ArcView, then run this script. A
new table will be created by using DDE to talk to Excel. This script
doesn't handle boolean fields, doesn't handle non-contiguous (a column
without a field name), always assumes dates are of the format MM/dd/yy,
and always writes a file called "C:\TEMP\EXCEL.DBF".
xyshift.ave
Name: View.ShiftFeatures
Title: Shifts XY coordinates for the features of a theme
Description: Shifts features in the current active Theme in the
input X and Y distance. A new theme is created as a result of the
shift. Only the selected features will be moved. If there are no
selected features then all features in the theme will be moved. The
units of the xy shift are the same units as the unprojected source
geometry.