Add Field To Analysis Layer (Network Analyst)

Adds a field to a network analysis layer.


Usage tips

Syntax

AddFieldToAnalysisLayer_na (in_network_analysis_layer, sub_layer, field_name, field_type, field_precision, field_scale, field_length, field_alias, field_is_nullable)
Parameter Explanation Datatype
Input network analyst Layer (Required)

Network analysis layer to which new field will be added.

Network Analyst Layer
Sub layer (Required)

Add new field to the selected sublayer of the input network analysis layer.

String
Field name (Required)

The name of the field that will be added to the specified sub layer of the input network analysis layer.

String
Field type (Required)

The field type used in the creation of the new field.

  • LONG—Numeric values without fractional values within a specific range.
  • TEXT—Names or other textual qualities.
  • FLOAT—Numeric values with fractional values within a specific range.
  • DOUBLE—Numeric values with fractional values within a specific range.
  • SHORT—Numeric values without fractional values within a specific range; coded values.
  • DATE—Date and/or Time.
  • BLOB—Images or other multimedia.

String
Field precision (Optional)

Describes the number of digits that can be stored in the field. All digits are counted no matter what side of the decimal they are on. This is only valid for numeric field types.

Long
Field scale (Optional)

Sets the number of decimal places stored in a field. This parameter is only used in Float and Double data field types.

Long
Field length (Optional)

The length of the field being added. This sets the maximum number of allowable characters for each record of the field. This option is only applicable on fields of type text or blob.

Long
Field alias (Optional)

The alternate name given to the field name. This name is used to give more descriptive names to cryptic field names. The field alias parameter only applies to geodatabases and coverages.

String
Field is nullable (Optional)

A geographic feature for which there is no associated attribute information. These are different from zero or empty fields and are only supported for fields in a geodatabase.

  • NON_NULLABLE—The field will not allow null values.

  • NULLABLE—The field will allow null values. This is the default.

Boolean
Data types for geoprocessing tool parameters

Script Example

import arcgisscripting
gp = arcgisscripting.create()

gp.AddFieldToAnalysisLayer(Route, "Stops", "MoreDelay", "DOUBLE", "", "", "", "", "NULLABLE")

See Also

  • An overview of the network Analysis toolset
  • An overview of the Network Analyst toolbox