# Filename: tri_close.py
# Purpose: Attempts to close an open triangulation.
# Returns: Bool.

from maptek import vulcan

input_tris = ['TQ1.00t', 'TQ2.00t','TQ3.00t','headframe.00t']

for solid in input_tris:
    with vulcan.triangulation(solid,'w') as tri:
        # check closure state    
        if tri.is_closed():
            print(f"{solid}: 'Closed'")
        else:
            print(f"{solid}: 'Not closed, attempting to close.'")
            tri.close()
            if tri.is_closed():
                print(f"{solid}: 'Closed'")
            else:
                print(f"{solid}: 'Could not close solid'")