# Filename: pl_length.py
# Purpose: Gets the length of a polyline (in plan or 3D).
# Returns: Double.

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:
    result = obj.length(True)  # True = plan view, False = not plan view 

    print(f"Length: {result}")