How can the script be improved?
Edit:
I have a different version of the script that is very similar, except it's purpose is just to print out the hierarchical components of the polyline geometry:
import arcpy
connection = "Database Connections\my_conn.sde"
feature_class = connection + "\my_owner.my_fc"
with arcpy.da.SearchCursor(feature_class, ["SHAPE@","OID@"]) as cursor:
for row in cursor:
geometry = row[0]
print("Geometry/Polyline: {}".format(row[1]))
for i, part in enumerate(geometry):
print(" Part: {}".format(i))
for j, point in enumerate(part):
print(" Point: {}".format(j))
>>>
Geometry/Polyline: 100
Part: 0
Point: 0
Point: 1
Point: 2
Point: 3
Point: 4
Part: 1
Point: 0
Point: 1
How does that sister script look?
Feel free to let me know if it should be it's own question.