Hi Ethan Duke ,
A small correction,the current version of ArcMap is 10.6 (10.6.0.8321). I just changed the code to create the tool and to do a test run. The updated code is:
def main():
import arcpy
import os
fc_in = arcpy.GetParameterAsText(0)
fld_count = arcpy.GetParameterAsText(1)
fc_out = arcpy.GetParameterAsText(2)
arcpy.AddMessage("Create output featureclass...")
sr = arcpy.Describe(fc_in).spatialReference
shp_type = (str(arcpy.Describe(fc_in).shapeType)).upper()
path, name = os.path.split(fc_out)
arcpy.CreateFeatureclass_management(path, name, shp_type, fc_in, "SAME_AS_TEMPLATE", "SAME_AS_TEMPLATE", sr)
cnt_feats = 0
with arcpy.da.SearchCursor(fc_in, '*') as curs_in:
flds_in = curs_in.fields
idx_cnt = flds_in.index(fld_count)
with arcpy.da.InsertCursor(fc_out, '*') as curs_out:
for row in curs_in:
cnt = row[idx_cnt]
lst_row = list(row)
lst_row[idx_cnt] = 1
row_out = tuple(lst_row)
for i in range(0, cnt):
cnt_feats += 1
if cnt_feats % 1000 == 0:
arcpy.AddMessage("Writing feature: {}".format(cnt_feats))
curs_out.insertRow(row_out)
arcpy.AddMessage("Finished writing {} features...".format(cnt_feats))
if __name__ == '__main__':
main()
The tool will look like this:
When I did some test runs the feature get duplicated based on the selected count field and the count field is reset to 1.
I did notice that your data has a GlobalID field. The problem with a GlobalID field is when write the the feature the GlobalID is changed in the output:
Do you have any attachments related to the points?
I can attach the toolbox, but possibly you won't be able to open it with ArcMap 10.5. I could create a 10.3 version at home which will be compatible with 10.5 that you have.