GetLayerNames()

Summary

Gets a list of all layers in the system.

Changes

In Version 2018 added the optional array of types.

Syntax

layer_array = GetLayers(opt array types)

Argument Contents
types An optional array of strings with one or more layer types

Returns

An array of layer name strings.

Notes

  • The array of types is an optional argument.

  • The array of types, if provided, restricts the layer types. For a description of the types, see IsLayer.

  • The list of layers includes layers that appear in any open map or dataview, and layers that are in the workspace but not in a map.

  • If there are no layers in the current application, GetLayerNames() returns null.

Example

lyrs = GetLayerNames({"Point"})
ShowArray(lyrs)

See Also

Function Summary
GetLayers() Gets information on layers in the system and the current layer
GetLayerType() Get the type of a layer
GetMapLayers() Gets a list of the layers in a map
AddLayerToWorkspace() Adds a layer to an application without it appearing in a map or dataview