# Filename: tri_load_grid.py
# Purpose: Create a triangulation from an existing grid.
# Returns: None.

from maptek import vulcan

input_tri = 'topo_from_grid.00t' # name for resulting triangulation
input_grid = 'thortopo.00g'

grid = vulcan.grid(input_grid)
assert(grid.ok), 'Error: Grid did not load.'

with vulcan.triangulation(input_tri, 'w') as tri:
    tri.load_grid(input_grid)
    tri.save()