I would like to convert the vertices of an existing Polyline-Shapefile into a Point Shapefile, but I have a problem with reading out the geometries of the polylines (getPart()).
outpath = os.path.split(SHPInput)
Temp_PointShp = gp.CreateFeatureclass(outpath[0],"SohlPoint_temp.shp", "POINT",None, "ENABLED", "ENABLED") # empty PointShapefile
gp.addfield_management(Temp_PointShp, "Z_Value", "DOUBLE")
gp.addfield_management(Temp_PointShp, "M_Value", "DOUBLE")
Srows = gp.SearchCursor(SHPInput) # Cursor
Irows = gp.InsertCursor(Temp_PointShp)
row = Srows.next()
while row: # for every row of the Polyline-Shapefile
Geom = row.shape # Geometry
OArray = Geom.getPart() # Array with Array
PArray = OArray.getPart(0) # Array with Points
Points = OArray.next()
while Points: # for all vertices...
row = Irows.NewRow() # create new row in Point-Shapefile
row.X = Points.X
row.Y = Points.Y
row.Z = Points.Z
row.M = Points.M
Irows.InsertRow(row)
Points = PArray.next()
row = Srows.next()