# Filename: pl_delete_point.py
# Purpose: Deletes a point from a line.
# Returns: Bool.

from maptek import vulcan_gui

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

for obj in sel:
   obj.delete_point(2)  # select the point to delete, in this case point 3 **
   
   '''
   ** Currently, there is not a method exposed to Python that allows
   users to select a specific point in a line.  To make sure you use the
   correct point index in the function call, right-click on the line in Vulcan, 
   then select Label > Point Sequence.  Recall that Python uses a zero-based 
   numbering scheme (0,1,2,3,...), so you will need to subtract 1 from the point 
   number shown on the screen, then use it as the index in delete_point(index).
   '''  

   sel.replace(obj)  # replaces the old object so changes are seen immediately