Actually I use Argis 9.3. sorry, i can't edit the indentation in the script, but i mark it with red colour. probably the problem occur in "create feature class" command, or in "insert cursor", this is confusing.
# Process: Add Field...
gp.AddField_management(InputFC__2_, "V", "DOUBLE", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")
# Process: Calculate Field...
gp.CalculateField_management(InputFC, "V", " * ", "VB", "")
# Process: Summary Statistics...
gp.Statistics_analysis(InputFC__3_, InputFC_Statistics_dbf, "D SUM;V SUM", "")
# create the output feature class using the spatial reference object
gp.CreateFeatureClass(New_Folder,OutputFC,"Point", "ENABLED","DISABLED",spatialRef)
gp.AddField_management(OutputFC,"D","DOUBLE","", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")
gp.AddField_management(OutputFC__2_,"H","DOUBLE"," ", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")
rows = gp.SearchCursor(InputFC_Statistics_dbf)
row = rows.Next()
while row:
count1 = row.SUM_V
count2 = row.SUM_D
prows = gp.InsertCursor(OutputFC__3_)
# create point object to create feature
pnt = gp.CreateObject("Point")
pnt.id = 1
pnt.x = 566020
pnt.y = 252044
prow = prows.NewRow()
prow.Shape = Point
prow.Dt = count2
prow.H = count1 / count2
Point.Add(pnt)
prows.InsertRow(prow)
row = rows.Next()
del prow, prows
del row, rows