# Get the name of a layer

from maptek import vulcan

dgd_file = "pydemo.dgd.isis"  # design database to access

with vulcan.dgd(dgd_file, "r") as dgd:  # open up the database in read mode
    layer_list = dgd.list_layers()  # get the list of layers
    for i, layer in enumerate(layer_list): # loop through layer_list with i as index
        new_layer = dgd.get_layer(layer_list[i])  # get a layer from the layer list
        layer_name = new_layer.get_name()  # get the name of the layer
        layer_description = new_layer.get_description()  # get the description of the layer
        print(f"layer name: {layer_name}\n   description: {layer_description}")
