def makeEvent(event): ''' Creates a table of events using fields plot and mark as a composite key plotmark all fields hardcoded: sampling_location plotmark plotid mark transect distance_along_transect fpc_number ''' try: curIn = arcpy.InsertCursor(event) for row in arcpy.SearchCursor(routeFC): plotmark = row.plotmark plotid = row.plotid mark = row.mark for pt in range(1,traps+1): # one-based counting rownew = curIn.newRow() rownew.sampling_location = plotid # field Increased rownew.transect = mark.strip() rownew.trap_number = int(pt) rownew.distance_along_transect = int(pt*spacing) # long?? rownew.plotmark = plotmark curIn.insertRow(rownew) del curIn del rownew del row countrow = str(arcpy.GetCount_management(event)) arcpy.AddMessage(event+" "+countrow) return None
Brad
You right-click on the top of the Arctoolbox tree and select Add Toolbox, I have already created the toolbox and it has the associated parameters etc. Just make sure that you unzipped the toolbox and its associated scripts in the same folder