laptop and a wrench

漏洞

Using the Field Calculator to execute a Python codeblock to calculate sequential numbers on a selected set of features in a geodatabase feature class only calculates sequential values in groups of 250 features. After each group of 250 features the sequential numbering starts over again.

上次发布: August 25, 2014 ArcGIS for Desktop
漏洞 ID 编号 NIM064043
已提交January 10, 2011
上次修改时间June 5, 2024
适用范围ArcGIS for Desktop
找到的版本10.0
操作系统Windows OS
操作系统版本XP
修正版本10.1
状态Fixed

解决办法

Use python window and update cursor in a script similar to the following:import arcpydef autoIncrement(): global rec pStart = 1 # Adjust start value, if req'd pInterval = 1 # Adjust interval value, if req'd if (rec == 0): rec = pStart else: rec += pInterval return rec# ################################# ################################ ## ## Attention User!!! Please Specify Feature for Calculation below.. ## ## ################################# ################################ #inFeatures = "Dallas_poles" # Specify feature to use for calculations# Add AutoInc fieldtry: arcpy.AddField_management(inFeatures, "AutoInc", "LONG", "", "", "", "", "NULLABLE")except: arcpy.GetMessages(2)# Create UpdateCursor Objectrows = arcpy.UpdateCursor(inFeatures)rec=0 # Declare rec variablefor row in rows: autoIncrement() # Perform autoIncrement() module row.AutoInc = rec # Set current row equal to rec rows.updateRow(row) # Update the row to reflect the changedel row, rows # Delete cursor and row objects to remove locks on the data

重现步骤

漏洞 ID: NIM064043

软件:

  • ArcGIS for Desktop

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项