# Delete attribute key

from maptek import vulcan

input_tri = "pit_solid.00t"  # triangulation to use

key = "flagged"  # key to delete

with vulcan.tri_attributes(input_tri) as tri:  # open triangulation in read mode
    if not tri.exists(key): # check if key exists
        key_list = tri.get_keys() # get list of keys
        print(f"The key '{key}' does not exist")
        print(f"List of keys: {key_list}")
    else:
        tri.delete_key(key)  # deletes the key if it exists
        key_list = tri.get_keys() # get list of keys
        print(f"The key '{key}' has been deleted")
        print(f"List of keys: {key_list}")
    