# Filename: tri_get_colour_index.py
# Purpose: Get the colour index of a triangulation.
# Returns: Integer.

from maptek import vulcan

input_tri = 'topo.00t' # input triangulation

with vulcan.triangulation(input_tri) as tri: # open triangulation in read mode
    if tri.is_rgb(): # check if triangulation uses rgb or colour index
        print(f"error: triangulation uses RGB") # error if tri is rgb
    else:
        icolour = tri.get_colour_index() # get triangulation colour index

        # do something...
        print(icolour)