# Filename: pl_make_counter_clockwise.py
# Purpose: Makes a polyline counter clockwise.
# Returns: None.

from maptek import vulcan_gui

# use dynamic selection to select correct line object
sel = vulcan_gui.selection("Select layer object to connect points.")
sel.criteria = ["LINE", "POLYGON"]  # limit selection to a polyline object
sel.single_object = True  # prevents selection prompt from asking more than once

for obj in sel:
    obj_name = obj.get_name()  # get name of object
    obj.make_counter_clockwise()  # set polyline to counter clockwise

    # report direction
    if obj.is_clockwise():
        print(f'{obj_name} is clockwise.')
    else:
        print(f'{obj_name} is counter-clockwise.')