# Filename: pl_filter.py
# Purpose: Filters a polyline by a distance tolerance.
# Returns: None.

from maptek import vulcan_gui

# use dynamic selection to select correct object
sel = vulcan_gui.selection("Select layer object.")
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.filter(50)  # filter by distance tolerance 
    sel.replace(obj)  # replaces the old object and preserves changes