# Import native arcgisscripting module # import arcgisscripting # Create the geoprocessor object # gp = arcgisscripting.create(9.3) infc = gp.GetParameterAsText(0) # Identify the geometry field # desc = gp.Describe(infc) shapefieldname = desc.ShapeFieldName # Create search cursor # rows = gp.SearchCursor(infc) row = rows.Next() # Enter while loop for each feature/row # while row: # Create the geometry object # feat = row.GetValue(shapefieldname) # Print the current multipoint's ID # print "Feature " + str(row.getvalue(desc.OIDFieldName)) + ":" partnum = 0 # Count the number of points in the current multipart feature # partcount = feat.PartCount # Enter while loop for each part in the feature (if a singlepart feature # this will occur only once) # while partnum < partcount: # Print the part number # print "Part " + str(partnum) + ":" part = feat.GetPart(partnum) pnt = part.Next() pntcount = 0 # Enter while loop for each vertex # while pnt: # Print x,y coordinates of current point # print pnt.x, pnt.y, pnt.z pnt = part.Next() pntcount += 1 # If pnt is null, either the part is finished or there is an # interior ring # if not pnt: pnt = part.Next() if pnt: print "Interior Ring:" partnum += 1 row = rows.Next()
Solved! Go to Solution.
dict = {} for v in centerDisplacement.values: dict[v.nodeLabel] = v.data[0] #sort dictionary list = sorted(dict, key=dict.get) max = list[-1] print 'Max displacement = ', dict[max] print 'For the Node label = ', max