Just give some idea on converting a Vectorscript palette script to Python.
The code splits a polyline/polygon into seperate line segments or linked curve segments which will give some idea how to
traverse polylines/polygons including holes. Hope the code is useful.
I did find that the VS call IsPolyClosed(polyH) is unreliable when you have invisible segments other than the last
and doesnt handle holes so I wrote my own "IsClosed"
I use a lot of STRUCTURE's