Monday, 20 April 2015

arcpy - Why does the method partCount in ArcGIS always give back a value of 1?


Does anyone knows why method "partCount" in arcgis version 10.0 always gives me back value 1, even when I have object with interniorring or multipart object?


partnum = 0
partcount = feat.partCount
while partnum < partcount:
outFile.write(str(inRow.GetValue(inDesc.OIDFieldName)) + " " + str(partnum) + "\n")
gp.AddMessage(str(inRow.GetValue(inDesc.OIDFieldName)) + " \\ " + str(partnum))

part = feat.getpart(partnum)
part.reset()
pnt = part.next()
pnt_count = 0
while pnt:
outLine = str(pnt_count) + " " + str(pnt.x) + " " + str(pnt.y) + " " + str(pnt.z) + " " + str(pnt.m) + "\n"
outFile.write(outLine.replace(".", sepchar))
pnt = part.next()
pnt_count += 1
if not pnt: # ?

pnt = part.next()
if pnt:
outFile.write("InteriorRing\n")


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...